ilteoood / docker-surfshark

Docker container with OpenVPN client preconfigured for SurfShark
MIT License
133 stars 34 forks source link

Cannot connect to socks5 proxy? #60

Closed dmountainwolf closed 1 year ago

dmountainwolf commented 1 year ago

I'm trying to use the builtin Dante socks5 server, but I'm simply unable to connect to it from outside the container, which is running using the following docker compose config:

version: '3'
services:

  vpn:
      image: ilteoood/docker-surfshark:1.6.1
      container_name: vpn
      environment: 
        - ENABLE_KILL_SWITCH=true
        - SURFSHARK_USER=ACTUAL_USER
        - SURFSHARK_PASSWORD=ACTUAL_PASS
        - SURFSHARK_COUNTRY=ca
        - SURFSHARK_CITY=tor
        - CONNECTION_TYPE=udp
        - CREATE_TUN_DEVICE=true
        # - LAN_NETWORK=192.168.0.0/24
      cap_add: 
        - NET_ADMIN
      ports:
        - 9117:9117
        - 6881:6881
        - 6881:6881/udp
        - 9118:9118
        - 9091:9091
        - 8082:80
        - 5000:5000
        - 8989:8989
        - 8686:8686
        - 1081:1081
        - 7878:7878
      restart: unless-stopped
      dns:
        - 1.1.1.1

From a terminal running on the host, outside the container when I try to run curl, I get the following output:

curl -v --socks5 127.0.0.1:1081 http://ifcfg.co
*   Trying 127.0.0.1:1081...
* Connection to proxy closed
* Closing connection 0
curl: (97) Connection to proxy closed

Is there anything else I can do to make the socks5 proxy available? I have already tried uncommenting LAN_NETWORK and that had no effect on the proxy.

ilteoood commented 1 year ago

The LAN_NETWORK configuration depends on your network. If your device IP is 192.168.1.100, for example, you must set LAN_NETWORK as follows: - LAN_NETWORK=192.168.1.0/24