go-libp2p
go-libp2p copied to clipboard
quic: improve simultaneous connect logic
We can fail the handshake earlier by hooking into the GetConfigForClient callback of the tls.Config.
This would require us to not save the peer ID in the holePunching map, and just use the remote address obtained from the net.Conn of the tls.ClientHelloInfo. This would bring QUIC more in line with what we're doing for hole punching in TCP: there we're happy to accept a hole-punch connection with any incoming connection coming from the expected remote address.