go-libp2p
go-libp2p copied to clipboard
webrtc: reuse port when dialing
depends on #2586
fixes: #2592
The fix turned out much simpler that I'd expected. Reusing the udp mux for dialing is straightforward.
Here we only reuse the listening udpmux. If not listening, a new mux is created everytime we dial.
Adds certhashes to discovered /webrtc-direct addresses. Unfortunately this is impossible to unit test currently. I'll manually verify this for now. The situation is the same for webtransport.
This is not useful without further work. Even if we reuse port when dialing, we will not dial anyone with a /webrtc-direct address as we will always prefer QUIC to webrtc-direct. This means, it'll not help us much with address discovery.