diff --git a/p2p/plugin/grpc_test.go b/p2p/plugin/grpc_test.go index e62235a..6307d2e 100644 --- a/p2p/plugin/grpc_test.go +++ b/p2p/plugin/grpc_test.go @@ -396,12 +396,12 @@ func TestHandshakeForward(t *testing.T) { } func TestSupportedDialer(t *testing.T) { - for _, name := range []string{"tcp", "tls", "ws", "mtcp", "mtls", "mws", "udp"} { + for _, name := range []string{"tcp", "tls", "ws", "wss", "grpc", "http2", "h2", "ssh", "sshd", "mtcp", "mtls", "mws", "mwss", "udp"} { if !xp2p.SupportedDialer(name) { t.Errorf("SupportedDialer(%q) = false, want true", name) } } - for _, name := range []string{"kcp", "quic", "grpc", "http2", ""} { + for _, name := range []string{"kcp", "quic", "bogus", ""} { if xp2p.SupportedDialer(name) { t.Errorf("SupportedDialer(%q) = true, want false (fail closed)", name) } diff --git a/p2p/tunnel_dialer.go b/p2p/tunnel_dialer.go index fcd34c9..79a65d5 100644 --- a/p2p/tunnel_dialer.go +++ b/p2p/tunnel_dialer.go @@ -55,8 +55,8 @@ func NewTunnelDialer(inner dialer.Dialer, t Tunnel, opts ...TunnelOption) dialer // protocol on top of a p2p tunnel. The wrapper's implicit contract is // "inner dials one plain conn via options.Dialer and uses it as its base" — // a byte stream for the stream dialers (mux inners dial it once per session -// and multiplex streams over it), a datagram stream for udp. kcp/quic -// bases, http2 probes and destroys tunnels. Fail closed: new dialers are +// and multiplex streams over it), a datagram stream for udp. kcp/quic bases +// break that contract and destroy tunnels. Fail closed: new dialers are // unsupported until verified. func SupportedDialer(name string) bool { switch name {