Use Cloudflare Workers to access your v2ray Vmess, Vless and Trojan configs through Websockets.
APACHE-2.0 License
๐ข 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.
Workers and Pages
to create and name a worker.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:
๐ก 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:
๐ 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.