Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 466d596

Browse files
committed
[代理]Websocket传递subprotocol参数
1 parent d83bf46 commit 466d596

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/teaproxy/request_websocket.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (this *Request) callWebsocket(writer *ResponseWriter) error {
4040
}
4141
return this.websocket.MatchOrigin(origin)
4242
},
43+
Subprotocols: websocket.Subprotocols(this.raw),
4344
}
4445

4546
// 自动补充Header
@@ -122,6 +123,7 @@ func (this *Request) callWebsocket(writer *ResponseWriter) error {
122123
},
123124
TLSClientConfig: tlsConfig,
124125
HandshakeTimeout: this.backend.FailTimeoutDuration(),
126+
Subprotocols: websocket.Subprotocols(this.raw),
125127
}
126128
header := http.Header{}
127129
for k, v := range this.raw.Header {

0 commit comments

Comments
 (0)