Skip to content

Commit

Permalink
fix(doc)
Browse files Browse the repository at this point in the history
  • Loading branch information
kizzx2 committed Oct 8, 2019
1 parent 0716e48 commit 12e3dae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ routing).

This supports directory style (where the certificates are not bundled together in one `.ovpn` file) and those that contains `update-resolv-conf`

(For the same thing in WireGuard, see [kizzx2/docker-wireguard-socks-proxy](https://github.com/kizzx2/docker-wireguard-socks-proxy))

## Why?

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](https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file) that most browsers support.

## Usage

Preferably, using `start` in this repository:
Expand All @@ -20,12 +26,12 @@ Alternatively, using `docker run` directly:
```bash
docker run -it --rm --device=/dev/net/tun --cap-add=NET_ADMIN \
--name openvpn-client \
--volume /your/openvpn/directory/:/etc/openvpn/:ro -p 1081:1080 \
--volume /your/openvpn/directory/:/etc/openvpn/:ro -p 1080:1080 \
kizzx2/openvpn-client-socks
```

Then connect to SOCKS proxy through through `local.docker:1081`. For example:
Then connect to SOCKS proxy through through `localhost:1080` / `local.docker:1080`. For example:

```bash
curl --proxy socks5:https://local.docker:1081 ipinfo.io
curl --proxy socks5h:https://local.docker:1080 ipinfo.io
```
4 changes: 2 additions & 2 deletions start
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

exec docker run \
--rm \
Expand All @@ -7,7 +7,7 @@ exec docker run \
--device=/dev/net/tun \
--name=openvpn-client \
--cap-add=NET_ADMIN \
--publish 127.0.0.1:1081:1080 \
--publish 127.0.0.1:1080:1080 \
--volume "$(realpath "$1"):/etc/openvpn/:ro" \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
kizzx2/openvpn-client-socks

0 comments on commit 12e3dae

Please sign in to comment.