Skip to content

Commit

Permalink
feat: Option to connect to P2P friendly servers (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Prasad Tengse <10941447+tprasadtp@users.noreply.github.com>
  • Loading branch information
jason-kurzik and tprasadtp authored Apr 16, 2021
1 parent 6469584 commit aaa7835
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Images are published on [GitHub Container Registry][ghcr].
| `PROTONVPN_TIER` | Yes | Proton VPN Tier (0=Free, 1=Basic, 2=Pro, 3=Visionary)
| `PROTONVPN_USERNAME` | Yes | OpenVPN Username. This is **NOT** your Proton Account Username.
| `PROTONVPN_PASSWORD` | Yes | OpenVPN Password. This is **NOT** your Proton Account Password.
| `PROTONVPN_SERVER` | Yes | ProtonVPN server to connect to. This value is mutually exclusive with `PROTONVPN_COUNTRY`. Only one of them can be used. Set it to `RANDOM` to connect to a random server.
| `PROTONVPN_SERVER` | Yes | ProtonVPN server to connect to. This value is mutually exclusive with `PROTONVPN_COUNTRY`. Only one of them can be used. Set it to `RANDOM` to connect to a random server. Set it to `P2P` to connect to fastest P2P server (does not work for free accounts).
| `PROTONVPN_COUNTRY` | Yes | ProtonVPN two letter country code. This will choose the fastest server from this country. This value is mutually exclusive with `PROTONVPN_SERVER`. Only one of them can be used.
| `PROTONVPN_PROTOCOL` | No | Protocol to use. By default `udp` is used.
| `PROTONVPN_EXCLUDE_CIDRS` | No | Comma separated list of CIDRs to exclude from VPN. Uses split tunnel. Default is set to `169.254.169.254/32,169.254.170.2/32`
Expand Down
3 changes: 3 additions & 0 deletions root/etc/services.d/protonvpn/run
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function connect_vpn()
elif [[ ${PROTONVPN_SERVER} == "RANDOM" ]] && [[ -z ${PROTONVPN_COUNTRY} ]]; then
echo "${SVC_CONN} Using Random Server"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect --random
elif [[ ${PROTONVPN_SERVER} == "P2P" ]] && [[ -z ${PROTONVPN_COUNTRY} ]]; then
echo "${SVC_CONN} Using Fastest P2P Server"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect --p2p
elif [[ -z $PROTONVPN_COUNTRY ]] && [[ -n ${PROTONVPN_SERVER} ]]; then
echo "${SVC_CONN} Using Server ${PROTONVPN_SERVER}"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect "${PROTONVPN_SERVER}"
Expand Down

0 comments on commit aaa7835

Please sign in to comment.