Skip to content

OpenVPN-client + SOCKS server in a Docker container

Notifications You must be signed in to change notification settings

ohpe/socks-my-vpn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socks my VPN

This is a small Docker image which blends together OpenVPN-Client and a SOCKS proxy server. Use it to isolate network changes.

Usage

bash run.sh ~/path/to/vpn-folder/

Alternatively:

docker run \
    --rm \
    -it \
    --privileged \
    --device=/dev/net/tun \
    --cap-add=NET_ADMIN \
    --env-file socks.config \
    -p 1080:1080 \
    --volume "~/path/to/vpn-folder/:/vpn/:ro" \
    --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    ohpe/socks-my-vpn:latest

SOCKS proxy server

The socks5 server is written in Go and forked from https://github.com/serjs/socks5-server. If works with or without authentication and the configurations can be set in the socks.config file.

Supported config parameters:

ENV variable Type Default Description
PROXY_USER String EMPTY Set proxy user (also required existed PROXY_PASS)
PROXY_PASSWORD String EMPTY Set proxy password for auth, used with PROXY_USER
PROXY_PORT String 1080 Set listen port for application

Test

Connect to proxy:

without auth:

curl --proxy socks5://127.1:$PROXY_PORT ipinfo.io

with auth:

curl --socks5 --user $PROXY_USER:$PROXY_PASSWORD 127.1:$PROXY_PORT ipinfo.io

About

OpenVPN-client + SOCKS server in a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published