Skip to content

Commit 89ffaee

Browse files
add Noise
1 parent 0fcbe89 commit 89ffaee

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

multiaddr_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ func TestConstructSucceeds(t *testing.T) {
169169
"/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct",
170170
"/ip4/127.0.0.1/tcp/127/ws",
171171
"/ip4/127.0.0.1/tcp/127/ws",
172+
"/ip4/127.0.0.1/tcp/127/tls",
172173
"/ip4/127.0.0.1/tcp/127/tls/ws",
174+
"/ip4/127.0.0.1/tcp/127/noise",
173175
"/ip4/127.0.0.1/tcp/127/wss",
174176
"/ip4/127.0.0.1/tcp/127/wss",
175177
}

protocols.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
P_GARLIC32 = 0x01BF
3030
P_P2P_WEBRTC_DIRECT = 0x0114
3131
P_TLS = 0x01c0
32+
P_NOISE = 0x01c6
3233
P_WS = 0x01DD
3334
P_WSS = 0x01DE // deprecated alias for /tls/ws
3435
)
@@ -202,7 +203,11 @@ var (
202203
Name: "tls",
203204
Code: P_TLS,
204205
VCode: CodeToVarint(P_TLS),
205-
Size: 0,
206+
}
207+
protoNOISE = Protocol{
208+
Name: "noise",
209+
Code: P_NOISE,
210+
VCode: CodeToVarint(P_NOISE),
206211
}
207212
protoWS = Protocol{
208213
Name: "ws",
@@ -243,6 +248,7 @@ func init() {
243248
protoUNIX,
244249
protoP2P_WEBRTC_DIRECT,
245250
protoTLS,
251+
protoNOISE,
246252
protoWS,
247253
protoWSS,
248254
} {

0 commit comments

Comments
 (0)