This commit is contained in:
gospider
2024-12-16 22:25:45 +08:00
parent 207dfc792c
commit 3c4eacf660
4 changed files with 14 additions and 8 deletions

View File

@@ -495,11 +495,14 @@ func (obj *DialClient) Socks5Proxy(ctx context.Context, ctxData *RequestOption,
if conn, err = obj.DialContext(ctx, ctxData, network, net.JoinHostPort(proxyUrl.Hostname(), proxyUrl.Port())); err != nil {
return
}
didVerify := make(chan struct{})
go func() {
if err = obj.clientVerifySocks5(conn, proxyUrl, remoteUrl); err != nil {
defer func() {
if err != nil && conn != nil {
conn.Close()
}
}()
didVerify := make(chan struct{})
go func() {
err = obj.clientVerifySocks5(conn, proxyUrl, remoteUrl)
close(didVerify)
}()
select {