You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: webrtc/browser-to-browser.md
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -40,12 +40,6 @@ TODO: Define which node on a relayed connection is _A_ and which one is _B_, i.e
40
40
41
41
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.
42
42
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
-
49
43
## STUN
50
44
51
45
TODO: Specify
@@ -62,6 +56,24 @@ Messages are sent prefixed with the message length in bytes, encoded as an unsig
62
56
// TODO: Support for offer, answer and ICE candidates
63
57
```
64
58
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
+
65
77
## FAQ
66
78
67
79
- Why is there no additional Noise handshake needed?
0 commit comments