/VpnProxyAdapter

VpnProxyAdapter is a Docker-based solution that simplifies internet access via VPN, centralizing VPN settings and enabling easy proxy setup for seamless connectivity.

VpnProxyAdapter

Overview

VpnProxyAdapter is a Docker-based solution that facilitates internet connections through VPN. The primary goal of this project is to centralize VPN settings, allowing other programs or services to utilize VPN connections simply by specifying proxy settings. This eliminates the need for individual programs to configure VPN settings, significantly reducing setup efforts.

Configuration

  1. Clone project

    git clone https://github.com/sammrai/VpnProxyAdapter.git
    
  2. Setting up the .env file

    The project root contains a .env file used to set environment variables for the VPN connection. Below is a sample .env file for using ExpressVPN.

    OPENVPN_USERNAME=your_username
    OPENVPN_PASSWORD=your_password
    OPENVPN_CONFIG=my_expressvpn_hong_kong_-_2_udp
    OPENVPN_PROVIDER=EXPRESSVPN
    
    • OPENVPN_USERNAME and OPENVPN_PASSWORD are the username and password provided by your VPN provider.
    • OPENVPN_PROVIDER is the name of the VPN provider you are using. While this project uses ExpressVPN as an example, you can choose any provider from the list of supported VPN providers.
    • OPENVPN_CONFIG is the name of the VPN configuration. For ExpressVPN, you can select from the Expressvpn-Proxy-Adapter ovpn_list.
  3. Starting the service

    Run the following command in the project directory to start the service.

    docker-compose up -d

This will launch the VPN connection and proxy service in the background, operating based on the configured .env file.

Usage

1. Using from within a container

Use the demo container your_container to verify that the IP address changes via VPN.

docker exec -it your_container curl ipinfo.io

2. Using from outside a container

After commenting in the ports setting of the vpnproxy service in the docker-compose.yml file to expose the proxy port to the host, use the following command to verify that the IP address changes via VPN.

curl ipinfo.io -x localhost:8901

Note