socks5-server icon indicating copy to clipboard operation
socks5-server copied to clipboard

Can't connect the proxy server with auth.

Open FisherMS opened this issue 5 years ago • 17 comments

image

2019/05/22 08:30:37 [ERR] socks: Unsupported SOCKS version: [4], 2019/05/22 08:30:37 [ERR] socks: Failed to authenticate: No supported authentication mechanism,

FisherMS avatar May 22 '19 08:05 FisherMS

When I don't use Auth and visits Youtube.com .

2019/05/22 08:49:09 Start listening proxy service on port 1080,
2019/05/22 08:49:33 [ERR] socks: Failed to get version byte: EOF,
2019/05/22 08:52:55 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:52136->172.217.0.14:443: read tcp 172.17.0.4:1080->101.231.126.26:50881: read: connection reset by peer,
2019/05/22 08:52:55 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:35718->172.217.4.46:443: read tcp 172.17.0.4:1080->101.231.126.26:50945: read: connection reset by peer,
2019/05/22 08:52:56 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:42962->172.217.4.238:443: read tcp 172.17.0.4:1080->101.231.126.26:51041: read: connection reset by peer,
2019/05/22 08:52:57 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:46006->172.217.8.174:443: read tcp 172.17.0.4:1080->101.231.126.26:51105: read: connection reset by peer,
2019/05/22 08:52:58 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:35732->172.217.4.46:443: read tcp 172.17.0.4:1080->101.231.126.26:51329: read: connection reset by peer,
2019/05/22 08:52:59 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:46010->172.217.8.174:443: read tcp 172.17.0.4:1080->101.231.126.26:51489: read: connection reset by peer,
2019/05/22 08:53:00 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:46012->172.217.8.174:443: read tcp 172.17.0.4:1080->101.231.126.26:51649: read: connection reset by peer,
2019/05/22 08:53:01 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:34160->172.217.9.46:443: read tcp 172.17.0.4:1080->101.231.126.26:51777: read: connection reset by peer,
2019/05/22 08:53:02 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:34162->172.217.9.46:443: read tcp 172.17.0.4:1080->101.231.126.26:51809: read: connection reset by peer,
2019/05/22 08:53:04 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:46018->172.217.8.174:443: read tcp 172.17.0.4:1080->101.231.126.26:51937: read: connection reset by peer,
2019/05/22 08:53:11 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:34168->172.217.9.46:443: read tcp 172.17.0.4:1080->101.231.126.26:52481: read: connection reset by peer,
2019/05/22 08:53:13 [ERR] socks: Failed to handle request: readfrom tcp 172.17.0.4:35748->172.217.4.46:443: read tcp 172.17.0.4:1080->101.231.126.26:53025: read: connection reset by peer,

FisherMS avatar May 22 '19 08:05 FisherMS

same question

alarmic avatar May 22 '19 14:05 alarmic

Think I'm having the same issue: With auth, AntennaPod gives "authentication failed". (Without auth, it works fine.) Curl also gives an error:

$ curl --socks5 xxx.x.xx.xx:8888 -U keunes:password http://ifcfg.co
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (4)

Now considering whether it's safe enough to run without auth on a non-default port. And if there's any way we can (help) debug this?

keunes avatar Nov 09 '22 21:11 keunes

@keunes Please provide server logs when you receive curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (4) error on client side. In addition, run curl with verbose logging. Can't complete SOCKS5 connection to 0.0.0.0:0. (4) - mostly on server side, but what exactly is going on - I haven't details.

Also, try to run http://ifcfg.co from host, maybe there are some DNS or Time Sync issues where server can't handle you request

serjs avatar Nov 10 '22 12:11 serjs

Hi @serjs,

Many thanks. From my laptop:

keunes@keunes:~$ curl -v --socks5 xxx.x.xx.xx:8888 -U keunes:password http://ifcfg.co
* Rebuilt URL to: http://ifcfg.co/
*   Trying xxx.x.xx.xx...
* TCP_NODELAY set
* SOCKS5 communication to ifcfg.co:80
* SOCKS5 connect to IPv6 xxxx:xxxx:xxxx::xxxx:xxx (locally resolved)
* Can't complete SOCKS5 connection to 0.0.0.0:0. (4)
* Closing connection 0
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (4)

On host:

pi@raspi:~ $ curl --socks5 xxx.x.xx.xx:8888 -U koenAP:1234 -v http://ifcfg.co
*   Trying xxx.x.xx.xx:8888...
* SOCKS5 connect to IPv6 xxxx:xxxx:xxxx::xxxx:xxx:xx (locally resolved)
* Can't complete SOCKS5 connection to ifcfg.co. (4)
* Closing connection 0
curl: (97) Can't complete SOCKS5 connection to ifcfg.co. (4)

pi@raspi:~ $ docker logs socks5
2022/11/10 17:35:01 Start listening proxy service on port 1080
2022/11/10 17:35:23 [ERR] socks: Failed to handle request: Connect to xxxx:xxxx:xxxx::xxxx:xxx:xx failed: dial tcp [xxxx:xxxx:xxxx::xxxx:xxx]:80: connect: cannot assign requested address
2022/11/10 17:43:33 [ERR] socks: Failed to handle request: Connect to xxxx:xxxx:xxxx::xxxx:xxx:xx failed: dial tcp [xxxx:xxxx:xxxx::xxxx:xxx]:80: connect: cannot assign requested address
2022/11/10 17:44:10 [ERR] socks: Failed to handle request: Connect to xxxx:xxxx:xxxx::xxxx:xxx:xx failed: dial tcp [xxxx:xxxx:xxxx::xxxx:xxx]:80: connect: cannot assign requested address

keunes avatar Nov 10 '22 18:11 keunes

Same problem here

image

DFlexy avatar Apr 20 '23 18:04 DFlexy

If you are using auth - then it's an issue with Chrome, that doesn't support auth with SOCKS5 proxies: https://bugs.chromium.org/p/chromium/issues/detail?id=256785 (info found here)

Drugoy avatar Apr 26 '23 15:04 Drugoy

I have the same problem with the FoxyProxy extension when authentication is enabled, The only place this has worked is TorBrowser. ( No supported authentication mechanism )

Screenshot 2024-01-04 021740

InstaZDLL avatar Jan 04 '24 01:01 InstaZDLL

Hi @alexng353 Sorry to tag you here. I saw you replied on the other issue related to authentication and even prepared a PR. So I was wondering - does 'regular' authentication work for you? Any idea about the issue we're experiencing here?

keunes avatar Jan 13 '24 06:01 keunes

does 'regular' authentication work for you?

Yeah, it works just fine for me. I've deployed the docker image with the following options:

docker run -d --name socks5 -p 1080:1080 -e PROXY_USER=MY_USERNAME -e PROXY_PASSWORD=MY_PASSWORD serjs/go-socks5-proxy

Running this test command yields a good download speed of roughly 300mbps on my shitty vps

curl --socks5-hostname MY_SERVER_CONNECT_URL -k -L https://bit.ly/1GB-testfile -o /dev/null

image

Two things are interesting and come to mind about this project.

  1. This repository is mostly dead
  2. The core dependency of this project https://github.com/armon/go-socks5, is also dead

It might be time to move on and create a new one-click deployable socks5 proxy written in golang, especially if this project is completely dead.

alexng353 avatar Jan 13 '24 08:01 alexng353

On a somewhat related but also not related, do you guys just not care about leaking your/your server's IP addresses? I mean I know that you can't do that much with an IP address but generally, its bad practice to leak it.

alexng353 avatar Jan 13 '24 08:01 alexng353

@alexng353 Do you know of an alternative project that provides a similar functionality (and preferably compiles into a single binary as well) that doesn't leak your IP? Please, let me know if you do. We all have noticed that unfortunately this project was abandoned. :(

Drugoy avatar Jan 13 '24 09:01 Drugoy

that doesn't leak your IP?

Potentially you misunderstood my comment? What I meant was that some people were posting screenshots of their configuration/console with intact IP addresses unblurred. I do not currently have an alternative project that provides similar functionality but I am working on one and should be done in a few days

https://github.com/alexng353/ihostproxy

Self-hosted proxy written in golang, heavily inspired by this project. I don't know if it's going to be 10 million download material, but it will surely work.

alexng353 avatar Jan 13 '24 18:01 alexng353

I also misunderstood the comment about leaking IP addresses @alexng353. Thanks for raising this issue.

I am working on one and should be done in a few days

Awesome that you're creating and sharing this. Will keep a look out on your progress.

keunes avatar Jan 13 '24 22:01 keunes

I thought you've found IP proxy client's IP leakage with this project, because some sites that I visited via this proxy detected me using a proxy (and I thought they could also had detected my client's IP) and refused services.

Drugoy avatar Jan 13 '24 23:01 Drugoy

and I thought they could also had detected my client's IP

To be honest I am not familiar enough with SOCKS5 or proxies in general to tell you whether or not they will be able to detect your client IP through this proxy.

alexng353 avatar Jan 14 '24 00:01 alexng353

Will keep a look out on your progress.

The proxy part already works. I'm working on IP whitelisting for connections and FQDN support after I read about what fqdn is and how it gets used in this serjs's project

alexng353 avatar Jan 14 '24 00:01 alexng353