Unverified Commit 8ae68cf3 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #122 from multiformats/feat/wss

feat: add wss protocol
parents 41a8e2e7 7bffa375
...@@ -149,6 +149,10 @@ func TestConstructSucceeds(t *testing.T) { ...@@ -149,6 +149,10 @@ func TestConstructSucceeds(t *testing.T) {
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio", "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio",
"/ip4/127.0.0.1/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio", "/ip4/127.0.0.1/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio",
"/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct", "/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct",
"/ip4/127.0.0.1/tcp/127/ws",
"/ip4/127.0.0.1/tcp/127/ws",
"/ip4/127.0.0.1/tcp/127/wss",
"/ip4/127.0.0.1/tcp/127/wss",
} }
for _, a := range cases { for _, a := range cases {
......
...@@ -29,6 +29,7 @@ const ( ...@@ -29,6 +29,7 @@ const (
P_GARLIC32 = 0x01BF P_GARLIC32 = 0x01BF
P_P2P_WEBRTC_DIRECT = 0x0114 P_P2P_WEBRTC_DIRECT = 0x0114
P_WS = 0x01DD P_WS = 0x01DD
P_WSS = 0x01DE
) )
var ( var (
...@@ -201,6 +202,11 @@ var ( ...@@ -201,6 +202,11 @@ var (
Code: P_WS, Code: P_WS,
VCode: CodeToVarint(P_WS), VCode: CodeToVarint(P_WS),
} }
protoWSS = Protocol{
Name: "wss",
Code: P_WSS,
VCode: CodeToVarint(P_WSS),
}
) )
func init() { func init() {
...@@ -230,6 +236,7 @@ func init() { ...@@ -230,6 +236,7 @@ func init() {
protoUNIX, protoUNIX,
protoP2P_WEBRTC_DIRECT, protoP2P_WEBRTC_DIRECT,
protoWS, protoWS,
protoWSS,
} { } {
if err := AddProtocol(p); err != nil { if err := AddProtocol(p); err != nil {
panic(err) panic(err)
......
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