move ws protocol definitions (ec8d1818a2/websocket.go (L23))

This commit is contained in:
godcong 2019-09-18 14:07:40 +08:00
parent c80d054253
commit 0550a5ba36
1 changed files with 7 additions and 0 deletions

View File

@ -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)