Make DialTimeout configurable.

This commit is contained in:
NI
2019-08-12 23:50:24 +08:00
parent db633f59bd
commit f3336d61a0
17 changed files with 173 additions and 119 deletions

View File

@@ -42,7 +42,8 @@ func BuildSocks5Dial(
timeout time.Duration,
) (net.Conn, error) {
dial, dialErr := proxy.SOCKS5("tcp", socks5Address, auth, &net.Dialer{
Timeout: timeout,
Timeout: timeout,
Deadline: time.Now().Add(timeout),
})
if dialErr != nil {