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)