Skip to content

Instantly share code, notes, and snippets.

@amiremohamadi
Created January 3, 2023 10:16
Show Gist options
  • Select an option

  • Save amiremohamadi/6794d57dbd385ae62aee434afb2fbc72 to your computer and use it in GitHub Desktop.

Select an option

Save amiremohamadi/6794d57dbd385ae62aee434afb2fbc72 to your computer and use it in GitHub Desktop.
Vmess V2ray Over Websocket on Cloudflare Workers
{
"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"
}
]
}
// 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