From 97b4ca0fc8d999dc02e9d351866438fc1e2fd1d6 Mon Sep 17 00:00:00 2001 From: Sukun Date: Sat, 2 Dec 2023 14:29:04 +0530 Subject: [PATCH] webrtc: clarify that there is no reuseport functionality (#2652) Co-authored-by: Marten Seemann --- p2p/transport/webrtc/transport.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p2p/transport/webrtc/transport.go b/p2p/transport/webrtc/transport.go index dd4028d1f2..c13ad19b1e 100644 --- a/p2p/transport/webrtc/transport.go +++ b/p2p/transport/webrtc/transport.go @@ -177,6 +177,11 @@ func (t *WebRTCTransport) CanDial(addr ma.Multiaddr) bool { return dialMatcher.Matches(addr) } +// Listen returns a listener for addr. +// +// The IP, Port combination for addr must be exclusive to this listener as a WebRTC listener cannot +// be multiplexed on the same port as other UDP based transports like QUIC and WebTransport. +// See https://github.com/libp2p/go-libp2p/issues/2446 for details. func (t *WebRTCTransport) Listen(addr ma.Multiaddr) (tpt.Listener, error) { addr, wrtcComponent := ma.SplitLast(addr) isWebrtc := wrtcComponent.Equal(webrtcComponent)