A proxy for Cisco AnyConnect VPNs running in a Docker container. This project combines OpenConnect with TinyProxy to provide a simple way to access resources behind a Cisco AnyConnect VPN through a proxy server.
- Runs Cisco AnyConnect compatible VPN client (OpenConnect) in a container
- Provides HTTP(S) proxy access through TinyProxy
- Supports TOTP-based multi-factor authentication
- Small Alpine Linux-based image (~30MB)
- Docker
- Docker Compose (optional)
- Cisco AnyConnect VPN credentials
Using the pre-built image from GitHub Container Registry:
docker run -d \
--name anyproxy \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
-p 8888:8888 \
-e VPN_USER=your-username \
-e VPN_PASS=your-password \
-e VPN_SERVER=vpn.example.com \
ghcr.io/the-codeboy/anyproxy:master- Clone this repository:
git clone https://github.com/the-codeboy/anyproxy.git
cd anyproxy- Copy the example environment file and adjust the values:
cp .env.example .envNote: for RWTH students there is a seperate .env.example.rwth which contains defaults for the RWTH vpn
- Build and start using Docker Compose:
docker compose up -dAlternatively you can build without Docker Compose:
docker build -t anyproxy .Then run the container:
docker run -d \
--name anyproxy \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
-p 8888:8888 \
--env-file .env \
anyproxyConfigure the following environment variables:
VPN_USER: Username for VPN authenticationVPN_PASS: Password for VPN authenticationVPN_SERVER: AnyConnect VPN server addressVPN_GROUP: (Optional) VPN group for connectionVPN_TOKEN: (Optional) Base32 TOTP token for MFA
The proxy will be available at localhost:8888
Configure your applications to use the proxy:
- Host: localhost
- Port: 8888
- Protocol: HTTP/HTTPS
If the container fails to start:
- Check if environment variables are properly set
- Verify VPN credentials are correct
- Ensure the container has the required capabilities (
NET_ADMIN) - Check if
/dev/net/tundevice is available on the host
MIT License
Copyright (c) 2025 the-codeboy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.