-
-
Save vfarid/37596c2583e48c723a29a743774998c0 to your computer and use it in GitHub Desktop.
This file contains 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
var list = { | |
"uuid1": [ | |
"vmess://xxxxxx", | |
"vless://xxxxxx" | |
], | |
"uuid2": [ | |
"vmess://yyyyyy", | |
"vless://yyyyyy" | |
], | |
... | |
} | |
export default { | |
async fetch(request, env) { | |
const uuid = (new URL(request.url)).pathname.replace(/^\//, '') | |
if (uuid in list) { | |
return new Response(btoa(list[uuid].join("\r\n"))) | |
} else { | |
return new Response('Invalid uuid!', { status: 404 }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment