Make DialTimeout configurable.

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

No files matched your search

+2 -1
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 {