Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support websocket subprotocl. #1092

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use HTTPHeader()
  • Loading branch information
LokiWager committed Sep 27, 2023
commit 54ddff151014c1a5f6468cb305eddfaf72ced5cb
4 changes: 2 additions & 2 deletions pkg/filters/proxies/httpproxy/wspool.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func (sp *WebSocketServerPool) handle(ctx *context.Context) (result string) {
InsecureSkipVerify: sp.spec.InsecureSkipVerify,
OriginPatterns: sp.spec.OriginPatterns,
}
subProtocol := req.Header().Get("Sec-WebSocket-Protocol")
subProtocol := req.HTTPHeader().Get("Sec-WebSocket-Protocol")
if subProtocol != "" {
opts.Subprotocols = []string{subProtocol.(string)}
opts.Subprotocols = []string{subProtocol}
}
clntConn, err := websocket.Accept(stdw, req.Std(), opts)
if err != nil {
Expand Down
Loading