mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-10-24 05:11:48 +00:00
Fix panic on websocket handshake failure
This commit is contained in:
parent
56f91dfeab
commit
bd602b6d11
1 changed files with 5 additions and 1 deletions
|
|
@ -81,7 +81,11 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) {
|
|||
if c.maxEarlyData > 0 {
|
||||
return &EarlyWebsocketConn{Client: c, rawConn: conn, create: make(chan struct{})}, nil
|
||||
}
|
||||
return c.upgrade(conn, &c.requestURL, c.headers)
|
||||
websocketConn, err := c.upgrade(conn, &c.requestURL, c.headers)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return websocketConn, nil
|
||||
}
|
||||
|
||||
func (c *Client) upgrade(conn net.Conn, requestURL *url.URL, headers http.Header) (*WebsocketConn, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue