A Docker container that provides a SOCKS5 proxy server routing traffic through Cloudflare WARP in proxy mode only. This implementation does not support full VPN mode - it only works as a SOCKS5 proxy. Supports both consumer WARP and Cloudflare for Teams (Zero Trust) configurations.
- SOCKS5 Proxy Server on port 1080 (mapped to host port 51080)
- Proxy Mode Only - Routes traffic through WARP proxy, not full VPN tunnel
- Cloudflare WARP Integration with automatic registration and connection
- Zero Trust Support with token-based team registration
- Persistent Configuration with volume mounting
- Health Checks to ensure WARP connectivity
- Automatic Retry Logic with connection failure handling
- Docker and Docker Compose
- For Teams usage: Valid Cloudflare for Teams token from your organization
- Important: For Teams usage, ensure "Proxy Mode" is enabled in your WARP profile settings
This container only supports WARP proxy mode, not full VPN mode. This means:
- β SOCKS5 Proxy: Applications must be configured to use the SOCKS5 proxy
- β System-wide VPN: Does not route all system traffic automatically
- β Application-specific: Only traffic routed through the proxy is affected
- β Transparent Proxy: Cannot intercept traffic without explicit proxy configuration
For Cloudflare for Teams usage:
- Your organization must have Proxy Mode enabled in WARP profile settings
- Navigate to:
Settings > WARP Client > Profile > Service Mode > Proxy - Create a profile specifically for proxy mode if needed
# Clone and start
git clone <repository>
cd wrap-cli
docker-compose up -d
# Check logs
docker-compose logs -f
# Test the proxy
curl --socks5 localhost:51080 https://ipinfo.io-
Get your team token from
https://YOUR_TEAM.cloudflareaccess.com/warp -
Set the token in docker-compose.yml:
environment:
- WARP_TOKEN=com.cloudflare.warp://yourteam.cloudflareaccess.com/auth?token=YOUR_JWT_TOKEN- Start the container:
docker-compose up -dports:
- "3128:1080" # Map to port 3128 instead- Port Mapping:
51080:1080(host:container) - Environment Variables: WARP_TOKEN for Teams usage
- Volume Mount:
./warp:/var/lib/cloudflare-warpfor persistent config - Health Checks: Monitors WARP connection status
- Process Management: Manages all services with proper dependencies
- Service Monitoring: Automatic restart of failed services
- Logging: Individual log files for each service in
/var/log/supervisor/ - Services Managed: WARP daemon, WARP setup, Dante proxy (D-Bus not required for proxy mode)
- WARP Configuration: Configures WARP on port 40000 in proxy mode
- Registration Logic: Handles both consumer and Teams registration
- Connection Monitoring: Continuous monitoring and reconnection logic
- Health Checks: Ensures WARP stays connected
- SOCKS5 Proxy Server: Dante server configuration
- Internal Interface: Listens on all interfaces (0.0.0.0) port 1080
- External Interface: Routes to localhost (127.0.0.1)
- Upstream Proxy: Forwards SOCKS5 traffic to WARP proxy on port 40000
- Authentication: No authentication required (socksmethod: none)
- Protocol Support: Both TCP and UDP traffic
Client β SOCKS5 (port 1080) β Dante Proxy β WARP Proxy (port 40000) β Cloudflare Network
# View all container logs
docker-compose logs -f warp-proxy
# Check supervisord status
docker exec warp-socks5-proxy supervisorctl status
# Check individual service logs
docker exec warp-socks5-proxy tail -f /var/log/supervisor/warp-setup.log
docker exec warp-socks5-proxy tail -f /var/log/supervisor/dante.log
docker exec warp-socks5-proxy tail -f /var/log/supervisor/warp-svc.log
# Check WARP status inside container
docker exec warp-socks5-proxy warp-cli status
# Restart specific service if needed
docker exec warp-socks5-proxy supervisorctl restart dante
docker exec warp-socks5-proxy supervisorctl restart warp-setup
# Test connectivity
curl --socks5 localhost:51080 https://ipinfo.io# Error: "Failed to connect WARP after 5 attempts"
# Solution: Enable Proxy Mode in Teams Dashboard
# Go to: Settings > WARP Client > Profile > Service Mode > Proxy# Change the host port in docker-compose.yml
ports:
- "DIFFERENT_PORT:1080"# Check if your network blocks WARP traffic
# Try different network or VPN# Check Dante configuration
docker exec warp-socks5-proxy cat /etc/danted.conf
# Check Dante logs
docker exec warp-socks5-proxy tail -f /var/log/danted.log
# Restart Dante if needed
docker exec warp-socks5-proxy pkill danted
docker exec warp-socks5-proxy danted -f /etc/danted.conf -D-
No Authentication on SOCKS5 Proxy
- Proxy accepts connections from any source (0.0.0.0/0)
- Risk: Unauthorized proxy usage if exposed to internet
- Recommendation: Add SOCKS5 authentication or restrict network access
-
Dante Configuration Now Active
- The dante configuration file (
danted.conf) is now actively used - Note: Implementation switched from socat to Dante SOCKS5 proxy server
- The dante configuration file (
# Restrict network access to trusted IPs only
iptables -A INPUT -p tcp --dport 51080 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 51080 -j DROP- Base Image: Ubuntu 24.04 (for GLIBC 2.39 compatibility)
- WARP Client: Latest stable version (2025.4.943.0)
- Proxy Method: Dante SOCKS5 server forwarding to WARP's built-in proxy
- User Management: Separate warpuser (UID 1001) for WARP operations
- Client connects to SOCKS5 proxy (port 1080)
- Dante SOCKS5 server forwards traffic to WARP proxy (port 40000)
- WARP proxy routes through Cloudflare network
- Response returns through same path
- WARP configuration stored in
./warpdirectory - Automatic registration recovery on container restart
- Health checks ensure continuous connectivity
# Update WARP_URL in docker-compose.yml
# Rebuild container
docker-compose build --no-cache
docker-compose up -d# Backup WARP settings
cp -r ./warp ./warp-backup-$(date +%Y%m%d)# Add to docker-compose.yml
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"| Variable | Description | Default | Required |
|---|---|---|---|
WARP_TOKEN |
Teams registration token | None | For Teams usage |
DEBIAN_FRONTEND |
Prevents interactive prompts | noninteractive |
Yes |
- Application-Specific Routing: Route specific applications through Cloudflare's network
- Development Testing: Test applications with different IP addresses via proxy
- API/Web Scraping: Route HTTP/HTTPS requests through WARP proxy
- Corporate Applications: Teams integration with Zero Trust policies for specific apps
- Selective Privacy: Choose which traffic goes through Cloudflare (not system-wide)
- Container Networking: Route containerized applications through WARP
Note: This is not a system-wide VPN - only applications configured to use the SOCKS5 proxy will be routed through WARP.
For issues related to:
- WARP Client: Check Cloudflare WARP documentation
- Teams Configuration: Contact your Cloudflare administrator
- Container Issues: Check logs with
docker-compose logs -f
This project is provided as-is for educational and development purposes. Ensure compliance with Cloudflare's Terms of Service and your organization's policies.