-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
SOCKS5 support for peer connections #160
Comments
I don't currently have plans to implement socks support. I'll take any PRs, cheers. |
I looked into this a little bit since this is a feature I would like as well, where the code would need to be changed is here in client.go:
Essentially we would replace the net.dialer with a proxy.dialer and pull the proxy from the config as a URL. Unfortunately the proxy package does not currently support DialContext, I didn't look around to see if other proxy packages did support it. However, adding Context with proxy support is listed as expected in Go 1.11 in July 2018. Until this it is beyond my ability to investigate. |
Thanks for looking into this. It looks like when this lands it'll be as simple as allowing a custom Dialer to be set for various Dials in the code base. If anyone needs this sooner, please recommend or refer us to an existing proxy implementation (that doesn't suck) that provides DialContext. |
Could we create a Dialer that implicitly performs the DialContext underneath, and use that as the forward argument to golang.org/x/net/proxy.FromURL? |
Here's an example of that kind of thing: https://github.com/anacrolix/missinggo/blob/master/reader_context.go |
Take a look at #256 |
Proxy support has been added by @elgatito , see the ProxyURL field in the Config struct. |
@gen2brain or anyone else following this thread: Are there any good socks5 client packages that support SOCKS5, and possibly UDP ASSOCIATE? |
@elgatito I know you don't use this repo actively anymore, but do you know what would be required to support incoming connections over SOCKS? Would that be TCP BIND and UDP ASSOCIATE? The PR that you made allowed outgoing SOCKS connections? Do you know if it worked for UDP? Cheers |
I've opened anacrolix/go-libutp#17, as I suspect go-libutp will require some extra configuration to support SOCKS. |
@deranjer https://pkg.go.dev/golang.org/x/net/proxy#ContextDialer now exists. My limited understanding of SOCKS suggestions this is only the outgoing part. We still need special support to receive incoming connections. |
Hi, I am still browsing through this package, I don't see a way to configure proxy. Can I do something with golang.org/x/net/proxy , I am interested in socks5 proxy.
Thanks
The text was updated successfully, but these errors were encountered: