mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
sync
This commit is contained in:
9
dial.go
9
dial.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user