-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to establish an outbound relay connection #2897
Comments
@PradaJoaquin what was the reason for this issue. I have it too! Can you help? |
Hey @silkroadnomad, unfortunately, I wasn’t able to resolve the issue. The issue occurred because I was trying to connect from a browser peer to a non-local Node.js peer. Currently, the only supported transport I found for this scenario is WebRTC, which requires a third node to act as a relay. However, I couldn't get the browser peer to connect in any way, except when using unsecured WebSockets, which only worked in a local environment. Initially, I closed the issue, assuming it was a problem on my end since no one else seemed to be experiencing it. I’ll leave it open now to see if anyone can help. I’m currently waiting for support for WebRTC-Direct, which might help resolve this specific problem. Any insights or suggestions would be greatly appreciated! |
@PradaJoaquin , you have the same tech stack as me. I am also using orbitdb, helia, and I do browser code only. And Svelte, which uses vite too. There is no server code on my site, but I need to switch off the ssr and do some other little tweaks. I could resolve my issue by simply upgrading all packages to the latest versions. As far as I remember. But it took the whole day. My browser connects with the relay. I am using PubSubPeerDiscovery, which is used to connect the browser directly with esch other directly via circuit-relay and dcutr via WebRTC peer-to-peer. There's another bug in the latest versions here which somehow prevented to deliver Multiaddresses to the other browser! So no connects! #2883 But your browser should definitely connect with your relay without waiting for WebRTC-direct. There's a simple chat example I tried today it works too. Check out the universal connectivity example, which has a rust and a go relay as alternativ, which are easy to start. The js-frontend unfortunately has a bug at the moment, too, but this seemed to work like a sharm in an older version. I am tomorrow trying to find the older libp2p version where PubSubPeerDiscovery worked. Let's see. |
Hey @silkroadnomad, glad to hear you resolved the issue! I already tried upgrading all packages to the latest versions but had no luck. My browser peers can successfully connect to a relay without any issues. In my case, I have Node.js peers that discover public relays via the DHT, connect to them, and announce their WebRTC addresses. However, the issue arises when I try to connect from the browser to a Node.js peer using its relayed WebRTC address. That's why I think WebRTC-Direct or WebTransport could help with this, similar to how the browser is already directly connecting to Go and Rust peers. Until then, I’ve stopped trying with WebRTC and recently started looking for alternatives—like you suggested, AutoSSL—as a potential way to establish browser-to-Node.js connections. However, I couldn't get the example to work. It never prints the multiaddr(s) that include the Server Name Indication (SNI), though I still need to do more testing. Unfortunately, the universal connectivity example does not include a Node.js peer—only a browser peer—so I couldn't use it to test my specific case. I’d love to check out the example you mentioned! |
@PradaJoaquin checkout release v0.2(!) of this websocket relay with nginx and letsencrypt. It is libp2p 1.3.0 from 10 months ago. Follow the instructions which work on a public hosted IP with configured domain name. (Don't use higher version, it is highly experimental and a bit out of your described scope) https://github.com/silkroadnomad/libp2p-relay/tree/v0.2/ I call all NodeJS libp2p nodes relay, I know its not always correct, but in my case, I run them always in the public internet to play relay for browser peers. Take care, that the syntax of libp2p config at the time was different, which still leads to some confusion on my end from time to time. |
Version:
libp2p 2.4.2
circuit-relay-v2 3.1.6
Platform:
Linux & Windows 64-bit
Severity:
Medium
Description:
I am unable to establish an outbound relay connection. Whenever the listener peer receives a new relayed connection, it fails due to the following error:
MuxerClosedError: Muxer closed locally
Below is the log output from the listener peer while testing different transports from the dialer.
Log Output:
Steps to reproduce the error:
Configure a listener peer with libp2p and enable circuit relay v2.
Dial the listener peer via the relay using a separate libp2p instance.
Expected Behavior:
The listener peer should successfully accept the relayed connection, and the connection should remain stable for further communication.
Actual Behavior:
The listener peer fails to maintain the connection, encountering the error, on the debug logs,
MuxerClosedError: Muxer closed locally
.Question:
Thank you for your assistance!
listener:
package.json
The text was updated successfully, but these errors were encountered: