Fix: query string parse on ws-opts
(#2213)
This commit is contained in:
parent
8c7c8f4374
commit
f0952b55d0
@ -256,10 +256,16 @@ func streamWebsocketConn(conn net.Conn, c *WebsocketConfig, earlyData *bytes.Buf
|
|||||||
dialer.TLSClientConfig = c.TLSConfig
|
dialer.TLSClientConfig = c.TLSConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u, err := url.Parse(c.Path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("parse url %s error: %w", c.Path, err)
|
||||||
|
}
|
||||||
|
|
||||||
uri := url.URL{
|
uri := url.URL{
|
||||||
Scheme: scheme,
|
Scheme: scheme,
|
||||||
Host: net.JoinHostPort(c.Host, c.Port),
|
Host: net.JoinHostPort(c.Host, c.Port),
|
||||||
Path: c.Path,
|
Path: u.Path,
|
||||||
|
RawQuery: u.RawQuery,
|
||||||
}
|
}
|
||||||
|
|
||||||
headers := http.Header{}
|
headers := http.Header{}
|
||||||
|
Reference in New Issue
Block a user