Force http/1.1 for websocket

This commit is contained in:
SALLEYRON Julien 2017-10-20 17:38:04 +02:00 committed by Traefiker
parent 9c8df8b9ce
commit afbad56012
5 changed files with 69 additions and 5 deletions

View file

@ -264,7 +264,8 @@ func (f *websocketForwarder) serveHTTP(w http.ResponseWriter, req *http.Request,
dialer := websocket.DefaultDialer
if outReq.URL.Scheme == "wss" && f.TLSClientConfig != nil {
dialer.TLSClientConfig = f.TLSClientConfig
dialer.TLSClientConfig = f.TLSClientConfig.Clone()
dialer.TLSClientConfig.NextProtos = []string{"http/1.1"}
}
targetConn, resp, err := dialer.Dial(outReq.URL.String(), outReq.Header)
if err != nil {