Unverified Commit a7d9ced9 authored by Aarsh Shah's avatar Aarsh Shah Committed by GitHub

Secure Muxer Interface (#180)

parent 83ac1d37
......@@ -24,3 +24,17 @@ type SecureTransport interface {
// SecureOutbound secures an outbound connection.
SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, error)
}
// A SecureMuxer is a wrapper around SecureTransport which can select security protocols
// and open outbound connections with simultaneous open.
type SecureMuxer interface {
// SecureInbound secures an inbound connection.
// The returned boolean indicates whether the connection should be trated as a server
// connection; in the case of SecureInbound it should always be true.
SecureInbound(ctx context.Context, insecure net.Conn) (SecureConn, bool, error)
// SecureOutbound secures an outbound connection.
// The returned boolean indicates whether the connection should be treated as a server
// connection due to simultaneous open.
SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, bool, error)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment