mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-27 15:40:27 +08:00
TUN-3853: Respond with ws headers from the origin service rather than generating our own
This commit is contained in:
committed by
Nuno Diegues
parent
9c298e4851
commit
ed57ee64e8
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user