Joentje / nordvpn-proxy

Use NordVPN in your Docker stack
141 stars 53 forks source link

Added option for user to specify specific server #20

Closed brandomr closed 4 years ago

brandomr commented 4 years ago

What's New

This PR allows the user to optionally set an environment variable SERVER when they run the container (through docker run or in their docker-compose.yml).

If SERVER is not set, the default behavior of selecting the best server ensues.

If SERVER is set (for example, SERVER=us2484.nordvpn.com) then us2484.nordvpn.com is connected to until the specified load is exceeded.

How is this useful

A user may want to specify a server in a specific city.

Also, for some tasks, it may be beneficial to periodically rotate the VPN address. This could be managed by the container with some randomize flag, or it can be managed by an external process. This PR allows the user to control this connection criteria through an external process.

Joentje commented 4 years ago

Thanks for your contribution! I have checked the code, this looks OK to me.

I'll check it later today and probably merge it.

The idea to have a randomize is a really good idea 👍

brandomr commented 4 years ago

Thanks for taking a look! I really like this library 🚀

Joentje commented 4 years ago

I created an issue for the randomize. #21

Beebeeoii commented 3 years ago

hey, this is a really good feature! would like to ask if its possible to specify a list of servers instead of just one such that a random one within the list will be selected based on CRON?

thanks