serjs / socks5-server

667 stars 165 forks source link

Connection refused #34

Closed keunes closed 1 year ago

keunes commented 1 year ago

Hello,

I've started the container on my Raspberry Pi: docker run -d --name socks5 -p 8888:8888 -e PROXY_USER=keunes -e PROXY_PASSWORD=[password] serjs/go-socks5-proxy and confirm that it's running:

CONTAINER ID   IMAGE                   COMMAND     CREATED          STATUS          PORTS                                       NAMES
babf826ab2cd   serjs/go-socks5-proxy   "/socks5"   45 minutes ago   Up 45 minutes   0.0.0.0:8888->8888/tcp, :::8888->8888/tcp   socks5

On my router I have opened the port, redirecting to my RaspberryPi (protocol: TCP): afbeelding

However, when testing, I get a 'connection refused' error:

$ curl --socks5 xxx.x.xx.xx:8888 -U keunes:[password] http://ifcfg.co
curl: (7) Failed to connect to 185.6.51.97 port 8888: Connection refused

I'm also running a 'bare' nginx server on the RasPi but I think it shouldn't interfere as it's on another level. I've also set up UFW on the RasPi but I tried adding a rule to open port 8888 and that didn't help, and I think it shouldn't interfere anyway as docker manipulates iptables directly.

Any hints/ideas?

serjs commented 1 year ago

Hi!

Server listen 1080 port by default inside container.

You need to specify PROXY_PORT=8888 environment variable in your case or make docker port listener like 8888 -> 1080 (-p 8888:1080).

keunes commented 1 year ago

Thanks a lot! New with docker so I didn't put the correct info in the run command. Without auth I now get it to work.