Skip to content

Commit cbdb5fa

Browse files
committed
Add SNI
1 parent e8c0913 commit cbdb5fa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

protocols.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const (
3232
P_GARLIC32 = 0x01BF
3333
P_P2P_WEBRTC_DIRECT = 0x0114
3434
P_TLS = 0x01c0
35+
P_SNI = 0x01c1
3536
P_NOISE = 0x01c6
3637
P_WS = 0x01DD
3738
P_WSS = 0x01DE // deprecated alias for /tls/ws
@@ -228,6 +229,13 @@ var (
228229
Code: P_TLS,
229230
VCode: CodeToVarint(P_TLS),
230231
}
232+
protoSNI = Protocol{
233+
Name: "sni",
234+
Size: LengthPrefixedVarSize,
235+
Code: P_SNI,
236+
VCode: CodeToVarint(P_SNI),
237+
Transcoder: TranscoderDns,
238+
}
231239
protoNOISE = Protocol{
232240
Name: "noise",
233241
Code: P_NOISE,
@@ -285,6 +293,7 @@ func init() {
285293
protoUNIX,
286294
protoP2P_WEBRTC_DIRECT,
287295
protoTLS,
296+
protoSNI,
288297
protoNOISE,
289298
protoWS,
290299
protoWSS,

0 commit comments

Comments
 (0)