go-libp2p-tls
go-libp2p-tls copied to clipboard
handle TCP simultaneous open (option 4)
As described in https://github.com/libp2p/specs/pull/227#discussion_r349905051.
Another concern here is that we need to signal the role to the multiplexer, at least in the case of yamux. We might have to change the interface to return the role, or maybe we should change the transport upgrader to select based on the peer IDs. @stebalien thoughts?
@vyzo I can see two ways to do implement the signaling:
- Add a
IsClient() boolfunction theSecureConninterface, or - change the function signature of
SecureOutboundtoSecureOutbound(context.Context, net.Conn, peer.ID) (SecureConn, bool /*is client */, error).
I think that 2. would be the cleaner solution. Option 1. would also add IsClient() to all interfaces that build on top of SecureConn, and it's not clear if that function actually makes sense on those interfaces. For example, a stream multiplexer might decide to initialize itself in client mode on the server side, and in server mode on the client side.
Agreed, option 2 is what I chose for multiselect/1.1.
@vyzo Sounds good. Where can I see the code for ms-1.1? Can you give me a link the corresponding PRs?
https://github.com/libp2p/go-libp2p/issues/712 collects all the PRs together.