WebTransportError in firefox

12 Views Asked by At

I get a WebTransportError in firefox when the same code works in chromium. I don't know where to look at.

Context

I have a IPFS node running locally (kubo v0.27.0) and listening on:

/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv
/ip4/127.0.0.1/udp/4001/quic-v1/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv
/ip4/127.0.0.1/udp/4001/quic-v1/webtransport/certhash/uEiCQEENr7FShHOkuCAUCgW-oahGIGj0Mk3tOHXQjrsWGWQ/certhash/uEiCG3LMdW9dtRC_kXft2TlE66kZ4RX1MzQksLwxRgbJMVw/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv

I'm connecting to it with libp2p like this:


const local_peer = [
'/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv',
'/ip4/127.0.0.1/udp/4001/quic-v1/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv',
'/ip4/127.0.0.1/udp/4001/quic-v1/webtransport/certhash/uEiCQEENr7FShHOkuCAUCgW-oahGIGj0Mk3tOHXQjrsWGWQ/certhash/uEiCG3LMdW9dtRC_kXft2TlE66kZ4RX1MzQksLwxRgbJMVw/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv'
]

const libp2p = await createLibp2p({
  peerDiscovery: [
    bootstrap({
      list: local_peer
    })
  ],
  // in the web context, I want to use webtransport
  transports: [webTransport()],
  // necessary to allow connecting to localhost
  connectionGater: {
    denyDialMultiaddr: async () => false
  }
)}

// setup connection
libp2p.dial(local_peer.map(multiaddr))

Observation

In chromium debug console, network tab, I see a connection to https://127.0.0.1:4001/.well-known/libp2p-webtransport?type=noise and I can list peers and interact with them.

In firefox debug console, I see nothing in network tab, and the following error:

WebTransportError {
  "source": "session",
  "streamErrorCode": null,
  "name": "WebTransportError",
  "message": "WebTransport connection rejected",
  "code": 0,
  "result": 0,
  "filename": "",
  "lineNumber": 0,
  "columnNumber": 0,
  "data": null
}

Question

Where could the problem come from? I know that webtransport in firefox is only available in a secure context (https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/source), but local ip should allow skip this security. The error messages does not tell me a lot about the origin of the problem.

0

There are 0 best solutions below