This project provides a Cloudflare Workers-based proxy for V2Ray servers using WebSocket+TLS. It helps bypass firewalls by routing traffic through Cloudflare's global network.
- Proxies WebSocket+TLS connections to your V2Ray server
- Supports VMess, VLESS, and Trojan protocols
- Easy configuration through a web interface
- Generates shareable configuration links
- Uses Cloudflare's global network for improved connectivity and reduced latency
This solution uses Cloudflare Workers to act as a proxy between clients and your V2Ray server:
- The client connects to the Cloudflare Worker using WebSocket+TLS
- The Worker forwards the WebSocket connection to your V2Ray server
- The V2Ray server processes the connection and routes traffic accordingly
This approach has several benefits:
- Bypasses network restrictions that block direct connections to your server
- Leverages Cloudflare's global network for improved performance
- Adds an additional layer of obfuscation to your traffic
First, ensure your V2Ray server is properly configured with WebSocket+TLS:
{
"inbounds": [
{
"port": 443,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "your-uuid-here",
"alterId": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/your-path"
},
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/path/to/certificate.crt",
"keyFile": "/path/to/private.key"
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}- Sign up or log in to Cloudflare Dashboard
- Navigate to "Workers & Pages"
- Click "Create Application" and select "Create Worker"
- Give your worker a name (e.g.,
v2ray-proxy) - In the editor, delete all existing code and paste the contents of
v2ray_proxy_worker.js - Click "Save and Deploy"
- Visit your deployed Worker URL (e.g.,
https://v2ray-proxy.your-username.workers.dev) - Enter your existing V2Ray configuration (VMess, VLESS, or Trojan)
- Enter a Cloudflare Clean IP (you can use the default or find one that works well in your region)
- Click "Generate Proxy Config"
- Copy the generated configuration
Import the generated configuration into your V2Ray client:
- For Windows: V2RayN, Qv2ray
- For macOS: V2RayX, ClashX
- For Android: V2RayNG, Clash for Android
- For iOS: Shadowrocket, Quantumult X
For optimal performance, you may want to find Cloudflare IPs that work well in your region:
- Use tools like CloudflareSpeedTest to test Cloudflare IP performance
- Choose IPs with low latency and high stability
- Enter these IPs in the "Clean IP" field when generating your configuration
If you encounter issues:
- Connection Errors: Ensure your V2Ray server is properly configured with WebSocket+TLS
- Performance Issues: Try different Cloudflare Clean IPs
- Worker Errors: Check the Cloudflare Workers logs in your dashboard
- This proxy adds an additional layer of obfuscation but is not a complete security solution
- Always use strong encryption and authentication in your V2Ray configuration
- Be aware of Cloudflare's terms of service regarding proxy usage
For advanced users, you can modify the Worker script to:
- Add custom path handling
- Implement additional authentication
- Customize the web interface
- Add support for additional protocols
This project is released under the MIT License.