From 7c50915f20c64876da16ef5be36b6d0cccaf2490 Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Sun, 8 Aug 2021 23:30:29 +0800 Subject: [PATCH] ws: remove the `Sec-WebSocket-Protocol` header --- proxy/ws/client.go | 1 - proxy/ws/server.go | 1 - 2 files changed, 2 deletions(-) diff --git a/proxy/ws/client.go b/proxy/ws/client.go index 84dae1d..3bca9b4 100644 --- a/proxy/ws/client.go +++ b/proxy/ws/client.go @@ -97,7 +97,6 @@ func (c *ClientConn) Handshake(host, path, origin string) error { buf.WriteString("Origin: http://" + origin + "\r\n") } buf.WriteString("Sec-WebSocket-Key: " + clientKey + "\r\n") - buf.WriteString("Sec-WebSocket-Protocol: binary\r\n") buf.WriteString("Sec-WebSocket-Version: 13\r\n") buf.WriteString(("\r\n")) diff --git a/proxy/ws/server.go b/proxy/ws/server.go index 924a405..1b5c696 100644 --- a/proxy/ws/server.go +++ b/proxy/ws/server.go @@ -183,7 +183,6 @@ func (c *ServerConn) Handshake(host, path string) error { buf.WriteString("Upgrade: websocket\r\n") buf.WriteString("Connection: Upgrade\r\n") buf.WriteString("Sec-WebSocket-Accept: " + serverKey + "\r\n") - buf.WriteString("Sec-WebSocket-Protocol: binary\r\n") buf.WriteString(("\r\n")) _, err = c.Conn.Write(buf.Bytes())