in-web-browsers icon indicating copy to clipboard operation
in-web-browsers copied to clipboard

Leveraging ws://localhost provided by local IPFS node

Open lidel opened this issue 4 years ago • 1 comments

So js-ipfs running on a web page loaded via https:// is able to connect to ws://localhost:port provided by IPFS node running on the same machine as browser – PoC in https://github.com/ipfs/go-ipfs/issues/5251#issuecomment-767909144

We could enable WS transport in IPFS Desktop / Brave, but not sure how to leverage it in js-ipfs. This feels related to some prior discussions in https://github.com/ipfs/js-ipfs/issues/3022 and work made by @Gozala, but is also bit brittle (eg. localhost WS dials can be blocked for security reasons)

Open questions:

  • How useful this is today? Perhaps should we park this until IPFS nodes can rebroadcast WANT messages, we have a concept of superodes, or delegated downloads
  • Could localhost WS be added to bootstrap list? How would it work without knowing PeerID upfront? (this is not a /dnsaddr that we can resolve)

lidel avatar Jan 27 '21 00:01 lidel

WebTransport (https://github.com/libp2p/specs/pull/404) could provide an interesting alternative here, but TBD if browser vendors will allow using it in localhost / LAN contexts.

lidel avatar Aug 10 '22 17:08 lidel