Git Product home page Git Product logo

nordvpn-proxy's Introduction

nordvpn-proxy

This is a NordVPN client docker container that use the recommended NordVPN servers, and opens a SOCKS5 proxy.

What is this?

This is bubuntux/nordvpn with a rusty_socks SOCKS5 proxy. The usage is the exact same as bubuntux/nordvpn, except you can then expose port 1080 from the container to access the VPN connection via the SOCKS5 proxy. In short, this container:

  • Opens the best connection to NordVPN using bubuntux/nordvpn as a base.
  • Starts a SOCKS5 proxy that routes eth0 to nordlynx with rusty_socks.

Usage

NOTE: This container only works using the NordLynx technology.

docker run -it --rm --cap-add NET_ADMIN -p 1080:1080 -e USER=<email> -e PASS='<pass>' -e TECHNOLOGY=NordLynx twitchax/nordvpn-proxy

nordvpn-proxy's People

Contributors

fraxker avatar twitchax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nordvpn-proxy's Issues

healthcheck status - Starting

Hi,
I have the following status for this container in Portainer - Starting.

I ran healthcheck command from my concole and it turned that my system doesn't accept escaping quote. It works just w/o escapes.

fatal error: mlock failed

When I setup Firefox to use nordvpn-proxy as a SOCKS proxy, nordvpn-proxy quickly dies with the following error message:

runtime: mlock of signal stack failed: 12                                                                                                                                   
runtime: increase the mlock limit (ulimit -l) or                                                                                                                            
runtime: update your kernel to 5.3.15+, 5.4.2+, or 5.5+                                                                                                                     
fatal error: mlock failed                                                                                                                                                   
                                                                                                                                                                            
runtime stack:                                                                                                                                                              
runtime.throw(0xb9545e, 0xc)                                                                                                                                                
        /usr/local/go/src/runtime/panic.go:1112 +0x72                                                                                                                       
runtime.mlockGsignal(0xc000d34c00)                                                                                                                                          
        /usr/local/go/src/runtime/os_linux_x86.go:72 +0x107                                                                                                                 
runtime.mpreinit(0xc000d3f880)                                                                                                                                              
        /usr/local/go/src/runtime/os_linux.go:341 +0x78                                                                                                                     
runtime.mcommoninit(0xc000d3f880)                                                                                                                                           
        /usr/local/go/src/runtime/proc.go:630 +0x108                                                                                                                        
runtime.allocm(0xc00003d000, 0xbc1f28, 0x782579f7fd00)                                                                                                                      
        /usr/local/go/src/runtime/proc.go:1390 +0x14e                                                                                                                       
runtime.newm(0xbc1f28, 0xc00003d000)                                                                                                                                        
        /usr/local/go/src/runtime/proc.go:1704 +0x39                                                                                                                        
runtime.startm(0x0, 0xc0003b2101)                                                                                                                                           
        /usr/local/go/src/runtime/proc.go:1869 +0x12a                                                                                                                       
runtime.wakep(...)                                                                                                                                                          
        /usr/local/go/src/runtime/proc.go:1953                                                                                                                              
runtime.resetspinning()                                                                                                                                                     
        /usr/local/go/src/runtime/proc.go:2415 +0x93                                                                                                                        
runtime.schedule()                                                                                                                                                          
        /usr/local/go/src/runtime/proc.go:2527 +0x2de                                                                                                                       
runtime.park_m(0xc000ba5b00)                                                                                                                                                
        /usr/local/go/src/runtime/proc.go:2690 +0x9d                                                                                                                        
runtime.mcall(0x800000)                                                                                                                                                     
        /usr/local/go/src/runtime/asm_amd64.s:318 +0x5b                                                                                                                     
                                                                                                                                                                            
goroutine 1 [chan receive]:                                                                                                                                                 
main.wait(0xc000f74e90, 0xbc18d8, 0xc000310090)                                                                                                                             
        /builds/nordvpn/apps-source/linux-app/src/cmd/daemon/wait.go:17 +0xbd                                                                                               
main.main()                                                                                                                                                                 
        /builds/nordvpn/apps-source/linux-app/src/cmd/daemon/main.go:153 +0xb64                                                                                             
[pages of pages of stack traces...]
2020-12-01 23:50:03,582 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,583 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,667 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,669 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,832 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,833 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,961 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:03,962 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:04,134 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:04,135 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:04,170 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       
2020-12-01 23:50:04,171 ERROR [rusty_socks::connection] Cannot assign requested address (os error 99)                                                                       

Apparently this is a golang workaround for a kernel bug which is probably hampered by Docker restrictions. I was able to resolve this by adding --cap-add IPC_LOCK to the docker run command line. Might be worth a note in the docs.

doesn't work with latest "bubuntux/nordvpn"

I have cloned your repo and rebuilt the image. It pulled the newest version of "bubuntux/nordvpn". And containter doesn't work with it. The log says: Whoops! Connection failed. Please try again. If the problem persists, contact our customer support.

Which version have you used to build your image?

cannot connect via forwarded port

Hi, I can't connect to the proxy via host IP. It seems like port forwarding doesn't work as expected. However, I have Portainer on the same host connected to the same deafult bridge. And port forwarding works there as expected:

root@test1:/home/docker/nordvpn-proxy# iptables -L
....
Chain DOCKER (3 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             172.17.0.2           tcp dpt:9000
ACCEPT     tcp  --  anywhere             172.17.0.2           tcp dpt:8000
...
ACCEPT     tcp  --  anywhere             172.17.0.3           tcp dpt:socks
root@test1:/home/docker/nordvpn-proxy# curl -x socks5://172.17.0.3:1080  -L http://httpbin.org/ip
{
  "origin": "45.12.220.228"
}
root@test1:/home/docker/nordvpn-proxy# curl -x socks5://127.0.0.1:1080  -L http://httpbin.org/ip
{
  "origin": "45.12.220.228"
}
root@test1:/home/docker/nordvpn-proxy# curl -x socks5://192.168.xx.xx:1080  -L http://httpbin.org/ip
curl: (28) Failed to connect to 192.168.xx.xx port 1080: Timed out
root@test1:/home/docker/nordvpn-proxy# docker ps
CONTAINER ID        IMAGE                             COMMAND             CREATED             STATUS                       PORTS                                                                         NAMES
f6108bb357ad        twitchax/nordvpn-proxy            "/start.sh"         29 minutes ago      Up 29 minutes (healthy)      0.0.0.0:1080->1080/tcp                                                        nordvpn-proxy
34a07dc9d7a0        portainer/portainer-ce            "/portainer"        3 hours ago         Up 3 hours                   0.0.0.0:8000->8000/tcp, 0.0.0.0:9000->9000/tcp                                portainer
root@test1:/home/docker/nordvpn-proxy# docker container port nordvpn-proxy
1080/tcp -> 0.0.0.0:1080
root@test1:/home/docker/nordvpn-proxy# docker container port portainer
9000/tcp -> 0.0.0.0:9000
8000/tcp -> 0.0.0.0:8000
2021-03-15 14:09:58,442 INFO  [rusty_socks] Listen IP:    172.17.0.3
2021-03-15 14:09:58,442 INFO  [rusty_socks] Endpoint IP:  10.5.0.2
2021-03-15 14:09:58,442 INFO  [rusty_socks] Port:         1080
2021-03-15 14:09:58,442 INFO  [rusty_socks] Buffer Size:  2048
2021-03-15 14:09:58,442 INFO  [rusty_socks] Read Timeout: 5000
2021-03-15 14:09:58,442 INFO  [rusty_socks] Accept CIDR:  0.0.0.0/0
2021-03-15 14:09:58,442 INFO  [rusty_socks] Listening on tcp://172.17.0.3:1080 ... 
2021-03-15 14:12:23,823 INFO  [rusty_socks::connection] [pn2m] 172.17.0.1:59846 => 172.17.0.3:1080 => 10.5.0.2:43463 => 34.199.75.4:80
2021-03-15 14:19:52,296 INFO  [rusty_socks::connection] [Oxw9] 172.17.0.1:60422 => 172.17.0.3:1080 => 10.5.0.2:44993 => 54.166.163.67:80

Can't connect to SOCKS from windows client

Windows Host (running docker)
Maybe this is related to #7

I can't access the proxy from my windows client (hosting the docker container).

docker run -it --rm --cap-add NET_ADMIN -p 1080:1080 -e USER= -e PASS='' -e TECHNOLOGY=NordLynx twitchax/nordvpn-proxy
also tried "docker run -it --rm --cap-add NET_ADMIN -p 0.0.0.0:1080:1080 -e USER= -e PASS='' -e TECHNOLOGY=NordLynx twitchax/nordvpn-proxy" with no success

[Feature Request] Auto Rotate IP address

I've been trying to create a socks5 proxy that either round robins, or changes on a set interval, like every 2 minutes.

Do you think thats something you could add to this project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.