Skip to content

Instantly share code, notes, and snippets.

@vfarid
Created February 5, 2023 15:24
Show Gist options
  • Save vfarid/37596c2583e48c723a29a743774998c0 to your computer and use it in GitHub Desktop.
Save vfarid/37596c2583e48c723a29a743774998c0 to your computer and use it in GitHub Desktop.
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