Multiple VPN connections manager
Find a file
2021-11-01 18:02:43 +03:00
api Fixed configs folder creation 2021-11-01 15:36:13 +03:00
.gitignore Initial commit 2021-10-30 00:14:00 +03:00
Dockerfile Initial commit 2021-10-30 00:14:00 +03:00
README.md Update README.md 2021-10-30 18:11:57 +03:00
requirements.txt Changed requirements for cross-platform 2021-11-01 18:02:43 +03:00
sockd.conf Initial commit 2021-10-30 00:14:00 +03:00
start.sh Initial commit 2021-10-30 00:14:00 +03:00

openvpn-socks5

The application is a web server for managing multiple VPN connections and providing access to them in the form of local SOCKS5 proxies. The web server creates many VPN connections, and users connect to the VPN like a regular proxy server. The repository contains a docker image of an OpenVPN client bound to a SOCKS proxy. This supports configurations where certificates are concatenated into one .ovpn file.

architecture

Web server

Before you start you need to install the dependencies from requirements.txt.

pip install -r requirements.txt

Run it

Run the server with:

$ cd api
$ uvicorn main:app

INFO:     Started server process [23188]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Interactive API docs

Now go to http://127.0.0.1:8000/docs

You will see the automatic interactive API documentation provided by Swagger UI.

Docker image

Run it

docker run -it --cap-add=NET_ADMIN --device /dev/net/tun \
           -p your_port:1080 --dns 8.8.4.4 \
           -v /your/openvpn/directory:/vpn -d saronqw/openvpn-socks5

Or you can build your own image first, and then run it.

docker build -t image_name .
docker run -it --cap-add=NET_ADMIN --device /dev/net/tun \
           -p your_port:1080 --dns 8.8.4.4 \
           -v /your/openvpn/directory:/vpn -d image_name