Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/proxy: Dialer.Dial doesn't have a timeout #27874

Closed
Varunram opened this issue Sep 26, 2018 · 4 comments
Closed

x/net/proxy: Dialer.Dial doesn't have a timeout #27874

Varunram opened this issue Sep 26, 2018 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Varunram
Copy link

Varunram commented Sep 26, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

macOS 10.13, amd64

What did you do?

Try to use proxy.SOCKS5 for making connection via a proxy

What did you expect to see?

proxy.Dialer.Dial should have a timeout

net.Dial has a timeout but proxy.Dialer.Dial doesn't have a timeout. I guess behaviour is similar in both cases, so it would be nice to have a timeout for proxy as well.

Would be nice if there is a workaround as well, would be open to trying them out. Thanks!

@andybons andybons changed the title net/proxy: Dialer.Dial doesn't have a timeout x/net/proxy: Dialer.Dial doesn't have a timeout Sep 26, 2018
@andybons
Copy link
Member

@mikioh

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 26, 2018
@andybons andybons added this to the Unplanned milestone Sep 26, 2018
@wrfly
Copy link

wrfly commented Nov 26, 2018

Any updates?

@DeadNumbers
Copy link

Try this

func Client(socks, addr string) (net.Conn, error) {
	dialer, err := proxy.SOCKS5("tcp", socks, nil, &net.Dialer{Timeout: 3 * time.Second})
	if err != nil {
		return nil, err
	}
	conn, err := dialer.Dial("tcp", addr)
	if err != nil {
		return nil, err
	}
	return conn, err
}

@gopherbot
Copy link

Change https://golang.org/cl/168921 mentions this issue: proxy: add Dial (with context)

dweomer added a commit to dweomer/golang-net that referenced this issue May 1, 2019
The existing API does not allow client code to take advantage of Dialer
implementations that implement DialContext receivers. This a familiar
API, see net.Dialer.

Fixes golang/go#27874
Fixes golang/go#19354
Fixes golang/go#17759
Fixes golang/go#13455
dweomer added a commit to dweomer/golang-net that referenced this issue May 2, 2019
The existing API does not allow client code to take advantage of Dialer
implementations that implement DialContext receivers. This a familiar
API, see net.Dialer.

Fixes golang/go#27874
Fixes golang/go#19354
Fixes golang/go#17759
Fixes golang/go#13455
@golang golang locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants