kizzx2 / docker-wireguard-socks-proxy

Expose a WireGuard tunnel as a SOCKS5 proxy
https://hub.docker.com/r/kizzx2/wireguard-socks-proxy
MIT License
151 stars 36 forks source link

Proxy times out when connecting over LAN #6

Open reeseovine opened 3 years ago

reeseovine commented 3 years ago

I'm having trouble using the proxy over my local network. When I run the command

curl --socks5 127.0.0.1:1080 https://api.ipify.org

from the computer running the container I get the expected result, but if I run

curl --socks5 192.168.0.28:1080 https://api.ipify.org

from that computer or another on the same network it times out after about a minute with this error:

curl: (28) Failed to connect to 192.168.0.28 port 1080: Connection timed out

The port is open but it appears to leave connections hanging when they come through the machine's LAN IP address.

zeyugao commented 2 years ago

Same issue here, have you figured it out?

reeseovine commented 2 years ago

@zeyugao nope, but i ended up switching to gluetun instead which does everything i needed it to do!

K0IN commented 2 years ago

The problem (at least in my setup) was, the docker network MTU, you can set it inside a compose file (or globally in docker) checkout my fork where I have an example on how to fix it.

Tekka90 commented 2 years ago

Am also having the same issue... Scratching my head for few hours now... Tried the network with lower mtu, but didn't help... Is it working for someone ??

K0IN commented 2 years ago

try change the internal ip inside the sockd.conf, you can bind to a ip(0.0.0.0) instead of interface(eth0), i will Provider more info when i got time.

check this https://github.com/Lozy/danted/issues/18#issuecomment-303126008

(not tested btw)

Tekka90 commented 2 years ago

Hi Koin, This was indeed the first thing I tried 😊 but did not help. I continued scratching my head and found a solution. You need to route the external network using iptable inside the container... I did a fork containing that plus the capacity to manage multiple connexions... https://github.com/Tekka90/docker-wireguard-socks-proxy

UFervor commented 2 years ago

Hi Koin,

This was indeed the first thing I tried 😊 but did not help.

I continued scratching my head and found a solution. You need to route the external network using iptable inside the container...

I did a fork containing that plus the capacity to manage multiple connexions...

https://github.com/Tekka90/docker-wireguard-socks-proxy

It also works for me! Much Thanks.