As the title says, I’m wondering if it’s possible to make a p2phttp request from the browser to a server running a libp2p node that uses this library? GitHub - libp2p/go-libp2p-http: HTTP on top of libp2p
To be clear this is not in relation to WebTransport, as that did come up a number of times while I was searching around.
This library is implemented in Go and browsers use JS, but in the “Usage” example of the github repo it shows that the client simply needs to pass a transport value to the “Transport” configuration variable of the http.Client{}
and from there can make any requests it wants.
Looking at the Axios documentation for making HTTP requests from the browser it has a similar key name in the request configuration: axios - npm
In the p2phttp usage example that transport which is passed to the http client config was created using p2phttp.NewTransport(clientHost)
.
I’d like to try a similar thing with Axios as to what’s shown in this example but I’m not sure if it’s easy create that transport object in JS yet. Is it just a matter of patience before js-libp2p gets its own js-p2phttp library? Maybe this did have to do with WebTransport being integrated first so that a browser based node could be a first class node?
For my use case I can definitely stick with ordinary TLS, but ultimately I’d like to get away from having to rely on a certificate authority to provide secure http endpoints. For instance I’d like to set api.somename.eth (an ENS) to an IPNS ID that would provide both the front-end UI, but also serve any backend functions (mainly admin CMS type functions I have in mind)
Thanks for reading!