From 0550a5ba36138ad0d5b25f534f350674a54ca565 Mon Sep 17 00:00:00 2001 From: godcong Date: Wed, 18 Sep 2019 14:07:40 +0800 Subject: [PATCH] move ws protocol definitions (https://github.com/libp2p/go-ws-transport/blob/ec8d1818a2e6edad2496410cbc554df6fe930ea2/websocket.go#L23) --- protocols.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/protocols.go b/protocols.go index 23598cf..f3cf252 100644 --- a/protocols.go +++ b/protocols.go @@ -24,6 +24,7 @@ const ( P_GARLIC64 = 0x01BE P_GARLIC32 = 0x01BF P_P2P_WEBRTC_DIRECT = 0x0114 + P_WS = 0x01DD ) var ( @@ -163,6 +164,11 @@ var ( Code: P_P2P_WEBRTC_DIRECT, VCode: CodeToVarint(P_P2P_WEBRTC_DIRECT), } + protoWS = Protocol{ + Name: "ws", + Code: P_WS, + VCode: CodeToVarint(P_WS), + } ) func init() { @@ -187,6 +193,7 @@ func init() { protoP2P, protoUNIX, protoP2P_WEBRTC_DIRECT, + protoWS, } { if err := AddProtocol(p); err != nil { panic(err)