From a49050db2058b92d1b902c74ded2f41cbcdd8c50 Mon Sep 17 00:00:00 2001 From: Roman Manz Date: Wed, 31 May 2023 15:40:08 +0000 Subject: [PATCH] adding support for deprecated SPDY/3.1 websocket upgrades --- websocket.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/websocket.go b/websocket.go index 522b88e3..fcc72fc5 100644 --- a/websocket.go +++ b/websocket.go @@ -22,7 +22,8 @@ func headerContains(header http.Header, name string, value string) bool { func isWebSocketRequest(r *http.Request) bool { return headerContains(r.Header, "Connection", "upgrade") && - headerContains(r.Header, "Upgrade", "websocket") + ( headerContains(r.Header, "Upgrade", "websocket") || + headerContains(r.Header, "Upgrade", "SPDY/3.1")) } func (proxy *ProxyHttpServer) serveWebsocketTLS(ctx *ProxyCtx, w http.ResponseWriter, req *http.Request, tlsConfig *tls.Config, clientConn *tls.Conn) {