You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
When exposing a node's API over the internet, it's a common thing to have it behind a proxy and to protect it with authentication, the simplest one being HTTP BasicAuth.
While js-ipfs-http-client doesn't explicitly support authentication, it's relatively easy to use the custom header features to pass a Basic Auth header, such as: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
It's much trickier to do that with go-ipfs-api. While it's possible to construct the shell with NewShellWithClient() and to pass a custom http.Client, go's http.Client only support setting cookies.
The only way I found was to implement a custom http.Client with an overridden http.RoundTripper that will intercept each request to set the proper Basic Auth. But obviously, that's rather hacky and will break if a custom RoundTripper is required for an actual good reason.
Would you be willing to support those use-case natively in go-ipfs-api ?
This could be done two different ways:
as js-ipfs-http-client does, support custom headers