wfg / docker-openvpn-client

OpenVPN client with killswitch and proxy servers; built on Alpine
MIT License
353 stars 107 forks source link

Access from internet to socks5 not working from #43

Closed quyeticb closed 2 years ago

quyeticb commented 2 years ago

Hello, I'm using this docker for My Project. With compose config files

services:
  singapore:
    image: sock5_container
    container_name: singapore
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    volumes:
      - /root/vpn:/data/vpn
    restart: unless-stopped
    environment:
      - HTTP_PROXY=off
      - SOCKS_PROXY=on
      - KILL_SWITCH=off
      - SUBNETS=0.0.0.0/0
      - VPN_CONFIG_FILE=singapore.ovpn
      - PROXY_USERNAME=
      - PROXY_PASSWORD=
    ports:
      - 1081:1080

From vps server contain docker, with test command curl is ok curl -x socks5://127.0.0.1:1081 https://icanhazip.com But from outside vps (from internet) it's always timeout connection curl -x socks5://yyy.yyy.yyy.yyy:1081 https://icanhazip.com (with yyy.yyy.yyy.yyy is true vps ip)

My ip on internet: xxx.xxx.xxx.xxx, and if I'd change SUBNETS to xxx.xxx.xxx.xxx/32 => everthing is OK (extract ip)

I want allow all request from internet to socks5 on vps. How to do it? Thanks!

wfg commented 2 years ago

I'm not sure what the problem could be. Try setting the LISTEN_ON environment variable to 0.0.0.0. @DavideWalder recently added this. It may be necessary here.

quyeticb commented 2 years ago

LISTEN_ON=0.0.0.0 is still not working. I'll try edit source and build again. Thanks

danielsoheil commented 2 years ago

Try add your vps ip/subnet to SUBNETS environment variable

wfg commented 2 years ago

Try add your vps ip/subnet to SUBNETS environment variable

This is a little closer. The VPS IP now works on the VPS itself, instead of only localhost working, but it's still not working remotely.

quyeticb commented 2 years ago

Yes, It's not working. I think replace SUBNETS environment by WHITELIST for remote connect.

joeblowout commented 2 years ago

How is it?

wfg commented 2 years ago

This no longer reproduces in v3.0.0.

In my testing, I made sure to add my home IP to the SUBNETS variable (to allow connections). I don't actually think I tried that last time, so it may also work with older images.