English 🇬🇧 | 🇮🇷 فارسی
- YouTube Instructions
- New Update!! Deploy to Cloudflare Pages
🟢 In an environment where direct connection to v2ray configs is not available, this alternative way can route the traffic to the destination server via Cloudflare.
- Login or Signup at https://dash.cloudflare.com and verify your email address.
- Head to
Workers and Pages
to create and name a worker. - Click
Edit Code
code to enter the editing environment.
🟡 This method only works if your v2ray panel has a domain registered on Cloudflare with a TLS certificate, and Cloudflare proxy status switch to ON.
🟡 In your VPS v2ray panel, create a config with these specifications:
- Type: Vmess, Vless or Trojan
- Transporation: Websocket (WS)
- Security: TLS
- Host: Cloudflare-registered TLS-Certified Domain/Subdomain
- Port: 443
🟡 Get the latest version of the TLS V2ray Refiner Worker Script, copy and paste/upload the entire content to your Cloudflare worker and hit deploy. (Alternatively, you could copy the worker script from here)
🟡 Open the deployed version of the worker and enter the TLS config you created on your VPS, and hit Refine
.
🟠 This method only works if your v2ray panel is not bound to a Cloudflare-registered domain, or the domain doesn't have a TLS Certificate.
🟠 First create a hostname with Type A pointing to your server IPv4 address, in any free DNS websites like https://noip.com/
🟠 In your VPS v2ray panel, create a config with these specifications:
- Type: Vmess, Vless or Trojan
- Transporation: Websocket (WS)
- Security: None
- Host: Hostname pointing to your server's IP Address (If on Cloudflare, switch the PROXY to OFF)
- Port: 80
🟠 Get the latest version of the Non-TLS V2ray Refiner Worker Script, copy and paste/upload the entire content to your Cloudflare worker and hit deploy. (Alternatively, you could copy the worker script from here)
🟠 Open the deployed version of the worker and enter the Non-TLS config you created on your VPS. Set the hostname to the one you created in step 2. Enter a clean Cloudflare IP address that works on your network, and finally, hit Refine Config
.
🟢 The default port is 80. If your VPS config uses another port, edit the port in the script over at const workerPort = 80
and url.port = 80
accordingly (You need to edit both).
🟢 Allowed ports are those of Cloudflare TLS (443, 8443, 2053, 2083, 2087, 2096), changeable under const allowedPorts
.
🟢 You could get Clean IPs via IRCF Space Repo, but it's recommended to use Scanners.
- Handling Websockets snippet and the idea of Rewriting Configs UI tribute to Vfarid's v2ray-worker-merge.
- Handling Non-TLS configs snippet tribute to GetAFreeNode.