Fix client dial

This commit is contained in:
世界 2023-03-03 16:41:51 +08:00
parent dac782ca09
commit 78d8070aa6
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -66,7 +66,12 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) {
if err != nil {
return nil, err
}
return c.DialContextConn(ctx, conn)
shadowTLSConn, err := c.DialContextConn(ctx, conn)
if err != nil {
conn.Close()
return nil, err
}
return shadowTLSConn, nil
}
func (c *Client) DialContextConn(ctx context.Context, conn net.Conn) (net.Conn, error) {