Docker image that connects to an OpenVPN server and exposes an HTTP proxy (via dumbproxy) bound to that VPN interface. All proxy traffic exits through the VPN.
- HTTP/HTTPS proxy on port
8888routed through OpenVPN - Supports CONNECT method and forwarding of HTTPS connections
- Supports TLS operation mode (HTTP(S) proxy over TLS)
- Supports client authentication with client TLS certificates
- Supports HTTP/2
- Health check verifies the exit IP country matches the expected
COUNTRYcode
Two files must be provided at runtime:
| File | Description |
|---|---|
client.ovpn |
OpenVPN client config |
auth |
Credentials file (username on line 1, password on line 2) |
| Variable | Required | Description |
|---|---|---|
COUNTRY |
Yes | Expected country code (lowercase) of the VPN exit IP, e.g. de, us. Used by the health check. |
PROXY_USER |
No | Proxy username. When set together with PROXY_PASS, enables bcrypt authentication on port 8888. |
PROXY_PASS |
No | Proxy password. Must be set together with PROXY_USER. |
CMD_OPTS |
No | Extra flags passed directly to dumbproxy. Do not use together with PROXY_USER and PROXY_PASS. |
username
password
client
dev tun
reneg-sec 0
persist-tun
persist-key
ping 5
nobind
allow-compression no
remote-random
remote-cert-tls server
auth-nocache
route-metric 1
cipher AES-256-CBC
auth sha512
<ca>
-----BEGIN CERTIFICATE-----
.......................
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
.......................
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
.......................
-----END PRIVATE KEY-----
</key>
remote server.example.com
proto udp
port 1194
services:
proxy:
image: ghcr.io/rooty/proxy-vpn:latest
restart: always
privileged: true
devices:
- /dev/net/tun
dns:
- 8.8.8.8
volumes:
- /path/to/client.ovpn:/etc/openvpn/client.ovpn:ro
- /path/to/auth:/etc/openvpn/auth:ro
ports:
- 127.0.0.1:8888:8888
environment:
- COUNTRY=de
# optional: enable proxy authentication
# - PROXY_USER=myuser
# - PROXY_PASS=mypassword
healthcheck:
test: ["CMD", "check"]
interval: 2s
timeout: 60s
retries: 20
networks:
- vpn-net
networks:
vpn-net:docker-entrypoint.shruns init scripts, then startsrunit.runitstarts the OpenVPN service.- Once the VPN tunnel is up, OpenVPN calls
up.shwhich:- Adds policy-based routing so traffic from the VPN interface goes through the VPN gateway.
- Starts
dumbproxybound to port8888, with the source IP set to the VPN interface.
- If the VPN disconnects,
down.shrestartsdumbproxywithout the VPN hint (fail-safe). - The health check queries
ip-api.comand verifies the returned country code matchesCOUNTRY.