Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Dialling webrtc peers over webrtc-direct relay connection #171

Closed
Marcel-G opened this issue Jun 1, 2023 · 5 comments · Fixed by #174
Closed

Dialling webrtc peers over webrtc-direct relay connection #171

Marcel-G opened this issue Jun 1, 2023 · 5 comments · Fixed by #174
Labels

Comments

@Marcel-G
Copy link
Contributor

Marcel-G commented Jun 1, 2023

It's currently not possible to dial a peer over a relayed connection established with the /webrtc-direct transport.

For example, dialing a peer with the following multiaddr results in CodeError: webrtc protocol was not present in multiaddr

/ip4/127.0.0.1/udp/9090/webrtc-direct/certhash/uEiBUr89tH2P9paTCPn-AcfVZcgvIvkwns96t4h55IpxFtA/p2p/12D3KooWB64sJqc3T3VCaubQCrfCvvfummrAA9z1vEXHJT77ZNJh/p2p-circuit/webrtc/p2p/12D3KooWFNBgv86tcpcYUHQz9FWGTrTmpMgr8feZwQXQySVTo3A7

The problem lies in the splitAddr function which breaks the addr up using /webrtc which incorrectly matches both /webrtc-direct and /webrtc transports.

@maschad
Copy link
Member

maschad commented Jun 1, 2023

Your listening multiaddr looks correct, could you share your JS node config along with some more info on how you are dialling that address? As I had mentioned on the referenced issue you could take a look at universal connectivity to see how we where able to dial a browser node over webRTC using webRTCDirect as a relay.

@Marcel-G
Copy link
Contributor Author

Marcel-G commented Jun 1, 2023

I suspect this particular issue is something introduced since 1.1.2 b20875d#diff-ae86b5a052f8a01ec57238e9da2eca51b26220cf10e893315132f38887c13106L75 looks like an easy fix

Sorry for linking these issues together as they're not really related in the end.

Regarding universal connectivity, In it's current state, the webrtc connections don't continue to work after the relay is closed / after the reservation has expired. Is that the same for you?

@p-shahi
Copy link
Member

p-shahi commented Jun 1, 2023

Regarding universal connectivity, In it's current state, the webrtc connections don't continue to work after the relay is closed / after the reservation has expired. Is that the same for you?

@DougAnderson444 saw this same behavior when he used the universal connectivity app. I created libp2p/universal-connectivity#74, this needs investigation. I believe this was working at one point but could be misremembering. In any case, it not working is a bug

It's currently not possible to dial a peer over a relayed connection established with the /webrtc-direct transport.

Can you elaborate on your setup a bit more?
Do you have something like:
Browser Node A establish a webrtc-direct connection to Relay Node R, same with Browser Node B (webrtc-direct to R)
and the A tries to dial B's relayed multiaddr to establish a browser-to-browser webrtc connection?
Like @maschad mentioned, this works with the univeral connectivity app where node R is a relay server using rust-libp2p

is your relay node using js-libp2p?

@maschad
Copy link
Member

maschad commented Jun 1, 2023

I suspect this particular issue is something introduced since 1.1.2 b20875d#diff-ae86b5a052f8a01ec57238e9da2eca51b26220cf10e893315132f38887c13106L75 looks like an easy fix

You're correct, good catch! Thanks for opening the PR. I will close this issue for now as we have opened another issue to investigate the issue of relays closing connections

@maschad maschad closed this as completed Jun 1, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

🎉 This issue has been resolved in version 2.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants