Created
January 3, 2023 10:16
-
-
Save amiremohamadi/6794d57dbd385ae62aee434afb2fbc72 to your computer and use it in GitHub Desktop.
Vmess V2ray Over Websocket on Cloudflare Workers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "log": { | |
| "loglevel": "warning" | |
| }, | |
| "inbounds": [ | |
| { | |
| "port": 80, | |
| "protocol": "vmess", | |
| "settings": { | |
| "clients": [ | |
| { | |
| "id": "559cf12a-58f5-11ed-9b6a-0242ac120000", | |
| "alterId": 0 | |
| } | |
| ] | |
| }, | |
| "streamSettings": { | |
| "network": "ws", | |
| "security": "none", | |
| "wsSettings": {} | |
| } | |
| } | |
| ], | |
| "outbounds": [ | |
| { | |
| "protocol": "freedom" | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // cf workers | |
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| let url = new URL(request.url); | |
| url.hostname = 'HOST'; // doesn't accept ip. you can use https://www.noip.com and bypass this restriction | |
| let upstream = new Request(url, request); | |
| return fetch(upstream); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment