TUN-3853: Respond with ws headers from the origin service rather than generating our own

This commit is contained in:
Sudarsan Reddy
2021-02-04 18:03:34 +00:00
committed by Nuno Diegues
parent 9c298e4851
commit ed57ee64e8
4 changed files with 97 additions and 34 deletions

View File

@@ -90,16 +90,16 @@ func (wsc *wsConnection) Type() connection.Type {
return connection.TypeWebsocket
}
func newWSConnection(transport *http.Transport, r *http.Request) (OriginConnection, error) {
func newWSConnection(transport *http.Transport, r *http.Request) (OriginConnection, *http.Response, error) {
d := &gws.Dialer{
TLSClientConfig: transport.TLSClientConfig,
}
wsConn, resp, err := websocket.ClientConnect(r, d)
if err != nil {
return nil, err
return nil, nil, err
}
return &wsConnection{
wsConn,
resp,
}, nil
}, resp, nil
}