Skip to content

Commit 78fae26

Browse files
committed
Document open question on advertising support in Multiaddr
1 parent cc1a8f1 commit 78fae26

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

webrtc/browser-to-browser.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ TODO: Define which node on a relayed connection is _A_ and which one is _B_, i.e
4040

4141
The above browser-to-browser WebRTC connection establishment replaces the existing [libp2p WebRTC star](https://github.com/libp2p/js-libp2p-webrtc-star) and [libp2p WebRTC direct](https://github.com/libp2p/js-libp2p-webrtc-direct) protocols.
4242

43-
#### Open Questions
44-
45-
- Instead of using trickle ICE, we could as well wait for the candidate gathering.
46-
See https://github.com/pion/webrtc/blob/c1467e4871c78ee3f463b50d858d13dc6f2874a4/examples/insertable-streams/main.go#L141-L142 as one example.
47-
In the browser, one can wait for the [`icegatheringstatechange` event](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/icegatheringstatechange_event).
48-
4943
## STUN
5044

5145
TODO: Specify
@@ -62,6 +56,24 @@ Messages are sent prefixed with the message length in bytes, encoded as an unsig
6256
// TODO: Support for offer, answer and ICE candidates
6357
```
6458

59+
## Open Questions
60+
61+
- Do we need a mechanism for browsers to advertise support for WebRTC browser-to-browser?
62+
63+
Say that browser B supports WebRTC browser-to-browser.
64+
B listens via a relay and advertises its relayed address.
65+
A discovers B's relayed address.
66+
At this point A does not know whether B is a browser and thus supports WebRTC browser-to-browser, or whether B is e.g. a laptop potentially supporting TCP and QUIC hole punching via DCUtR but not WebRTC browser-to-browser.
67+
In the latter case, A can not establish a direct connection to B.
68+
69+
Potential solution would be for B to advertise some protocol after the `/p2p-circuit` within its Multiaddr, e.g. `/ip6/<RELAY_IP>/udp/4001/p2p/<RELAY_PEER_ID>/p2p-circuit/webrtc-direct/p2p/<B_PEER_ID>`.
70+
As an alternative, A can discover B's support via the identify protocol on the relayed connection or by optimistically opening a stream using the signaling protocol.
71+
Both of the latter options would on failure happen at the expense of a wasted relayed connection.
72+
73+
- Instead of using trickle ICE, we could as well wait for the candidate gathering.
74+
See https://github.com/pion/webrtc/blob/c1467e4871c78ee3f463b50d858d13dc6f2874a4/examples/insertable-streams/main.go#L141-L142 as one example.
75+
In the browser, one can wait for the [`icegatheringstatechange` event](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/icegatheringstatechange_event).
76+
6577
## FAQ
6678

6779
- Why is there no additional Noise handshake needed?

0 commit comments

Comments
 (0)