VPS 3Proxy via Cloudflare WARP

This guide will help you configure a proxy on your VPS and route the traffic through Cloudflare WARP using 3proxy and warp-cli. This setup enhances privacy, masks the server IP, and provides secure outbound connections.

1. Enable IP Forwarding and Local Routing

echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.route_localnet = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

These settings allow the Linux kernel to forward IP packets and route traffic to localhost for NAT redirection.

2. Install and Initialize Cloudflare WARP in Proxy Mode

curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt-get update && sudo apt-get install cloudflare-warp

Initialize WARP in proxy mode and set the proxy port (e.g., 40000):

warp-cli registration new
warp-cli mode proxy
warp-cli proxy port 40000
warp-cli connect

Ensure the WARP service is running:

sudo systemctl start warp-svc.service

3. Install and configuration 3proxy

wget https://github.com/3proxy/3proxy/releases/download/0.9.5/3proxy-0.9.5.x86_64.deb
sudo dpkg -i 3proxy-0.9.5.x86_64.deb

Open /etc/3proxy/3proxy.cfg and update config below

nscache 65536
log /var/log/3proxy/3proxy-%y%m%d.log D
logformat "L%d-%m-%Y %H:%M:%S %N %U %C:%c %R:%r %O %I %T"
rotate 60

# ===== User account ===== 
users youruser:CL:yourpassword

# ===== Proxy to WARP: port 1089 =====
auth strong
allow youruser
parent 1000 socks5 127.0.0.1 40000
socks -n -a -p1089
flush

Ensure the 3proxy service is running:

sudo systemctl start 3proxy.service

4. allow firewall/ufw

Open the Proxy Port in UFW

sudo ufw allow 1089/tcp

5. Test connect proxy SOCKS5

Use curl to verify that the proxy is working correctly

curl -x socks5://youruser:yourpassword@your-public-ip:1089 https://ifconfig.me

You should see a Cloudflare WARP IP address instead of your VPS’s real IP.