A minimal WireGuard HTTP/s proxy with TinyHTTP
7.3K
This project provides a minimal WireGuard HTTP/s proxy using TinyProxy. It allows you to run WireGuard as a VPN tunnel and route HTTP traffic through TinyProxy. This can be used in environments where WireGuard is needed for secure tunneling, and TinyProxy is used to manage HTTP/s traffic.
The project uses a custom Docker image based on linuxserver/wireguard with TinyProxy added.
Github Repo
The repo is based on the wireguard-http-proxy project.
The start.sh script manages the lifecycle of TinyProxy and WireGuard. It ensures that both TinyProxy and WireGuard are running and handles cleanup when the container is stopped.
The healthcheck.sh script checks the health of the WireGuard tunnels by pinging various endpoints. If any of the tunnels are down or unreachable, the script will fail, which helps to detect issues with the setup.
The WireGuard configuration files should be placed in the container at /config/wg_confs/ directory, or /conf.d/wireguard/gb_confs for docker compose . The start.sh script will automatically detect and load the configuration files.
Customized TinyProxy configuration file can be placed in the container at /app/tinyproxy/ directory. The start.sh script will automatically detect and load the configuration file.
You can use included docker compose example at deployment/docker-compose.yaml
Alternatively, to run the container with the default settings, use the following command:
docker run -d \
--name wireguard-proxy \
--hostname wireguard \
--env PEERS=false \
--env PUID=1000 \
--env PGID=1000 \
--cap-add NET_ADMIN \
--cap-add SYS_MODULE \
--volume ./conf.d/tinyproxy:/tinyproxy \
--volume ./conf.d/wireguard:/config \
--volume /lib/modules:/lib/modules \
--publish 8888:8888/tcp \
--sysctl net.ipv4.conf.all.src_valid_mark=1 \
myimage:latest
This command will start the container with TinyProxy running on port 8888 and WireGuard tunnels configured via the files in /config/wg_confs/.
You can also deploy this setup on Kubernetes using the following configuration files. The example includes an initContainer to ensure the correct sysctl value is set, along with the necessary configurations for WireGuard and TinyProxy.
Kubernetes does not support Dockerfile HEALTHCKECH, so we need to use a livenessProbe to check the health of the container. The healthcheck.sh script is used to check the health of the WireGuard tunnels.
The TinyProxy configuration is stored in a ConfigMap named tinyproxy-config. The ConfigMap is mounted as a volume in the container at /app/tinyproxy as a .conf file.
The WireGuard configuration files are stored in a Secret named wireguard-config. The Secret is mounted as a volume in the container at /config/wg_confs.
This project is licensed under the GNU General Public License v3.0 or later. See the LICENCE file for more details.
This version of the README.md reflects that the project is licensed under the GNU General Public License v3.0 or later. If you need further details or adjustments, let me know!
Content type
Image
Digest
sha256:c6be8985e…
Size
4 MB
Last updated
over 1 year ago
docker pull vst0name/httpproxy-wireguard:wireproxy