This is an example of proxying all request over a libp2p WebTransport
connection. The proxy is specified in the url after the #
, and all requests
will be made to the endpoint.
See the proxy-server folder for the implementation of the proxy server.
- Start the proxy server
cd go-libp2p-proxy-server && go run . -proxy-target "https://text.npr.org" -allowed-peers=*
. It'll print the proxy's multiaddr. - Start the webapp
npm run start
- Copy the proxy address, and go to
localhost:3000/#<proxy-multiaddr>
Be warned that if you proxy a local HTTP server you could open that server up to the internet if you listen on a public IP address. If you do this, it's recommended to be explicit in the allowed peer ids.