Expose WireGuard as a SOCKS5 proxy in a Docker container.
Add multiple arch support, and restored the "build ability" of the image.
This is arguably the easiest way to achieve "app based" routing. For example, you may only want certain applications to go through your WireGuard tunnel while the rest of your system should go through the default gateway. You can also achieve "domain name based" routing by using a PAC file that most browsers support.
Preferably, using start
in this repository:
bash start.sh /directory/containing/your/wireguard/conf/file
Alternatively, you can use docker run
directly if you want to customize things such as port mapping:
docker run -it --rm --cap-add=NET_ADMIN \
--name wireguard-socks-proxy \
-v ${PWD}:/etc/wireguard/:ro \
-p 1080:1080 \
ghcr.io/k0in/docker-wireguard-socks-proxy:latest
Then connect to SOCKS proxy through through 127.0.0.1:1080
(or local.docker:1080
for Mac / docker-machine / etc.). For example:
curl --proxy socks5h://127.0.0.1:1080 ipinfo.io
You can easily convert this to an HTTP proxy using http-proxy-to-socks, e.g.
hpts -s 127.0.0.1:1080 -p 8080
This can happen if your WireGuard configuration file includes an IPv6 address but your host interface does not work with it. Try removing the IPv6 address in Address
from your configuration file.
Try to add --sysctl net.ipv6.conf.all.disable_ipv6=1
to your docker run parameters.
this is a bug with docker the docker network / mtu have a look at the docker-compose.yml to fix it.