Circuit relay using Libp2p 0.46.21 not generating websocket addresses #2292
-
I have the following Libp2p configuration for a relay which generates websocket addresses which I can then connect to via a browser, completing discovery:
However, since upgrading to latest 0.46 (I.e. 0.46.21 via helia v2.1.0). the above configuration results in no available websocket addresses, the resulting listening addresses on the relay being:
Attempting to connect to any of these from a browser results in a "CodeError: The dial request has no valid addresses" error. Previously generated addresses (running Libp2p 0.46.17) looked like:
(note: ws/p2p) and could be connected to. Should libp2p be generating ws addresses? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm having trouble replicating this. package.json: {
"name": "libp2p-ws-test",
"version": "1.0.0",
"type": "module",
"dependencies": {
"helia": "^2.1.0"
}
} index.js: import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { mplex } from '@libp2p/mplex'
import { createLibp2p } from 'libp2p'
import { identifyService } from 'libp2p/identify'
import { circuitRelayServer } from 'libp2p/circuit-relay'
const node = await createLibp2p({
addresses: {
listen: ['/ip4/0.0.0.0/tcp/12345/ws']
},
transports: [
webSockets({
filter: filters.all
})
],
connectionEncryption: [noise()],
streamMuxers: [yamux(), mplex()],
services: {
identify: identifyService(),
relay: circuitRelayServer()
}
})
console.info('addrs', node.getMultiaddrs()) Output: % node index.js
addrs [
Multiaddr(/ip4/127.0.0.1/tcp/12345/ws/p2p/12D3KooWMZfWvLFQRd2YwPPdHvRRGYnoAvPUrUzyLjrDBAjzhwHz),
Multiaddr(/ip4/192.168.1.246/tcp/12345/ws/p2p/12D3KooWMZfWvLFQRd2YwPPdHvRRGYnoAvPUrUzyLjrDBAjzhwHz)
] |
Beta Was this translation helpful? Give feedback.
I'm having trouble replicating this.
package.json:
index.js: