Cloudflare Session Name Service (SNS/ONS) resolver worker
https://cf-ons-resolver.hloth.workers.dev/
.vscode | ||
src | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
bun.lock | ||
eslint.config.js | ||
LICENSE.md | ||
package.json | ||
README.md | ||
tsconfig.json | ||
wrangler.jsonc |
Cloudflare Session Name Service (SNS/ONS) resolver worker
Made with Elysia, running on Bun with WASM for id.session.community
Deployed version: cf-ons-resolver.hloth.workers.dev
You are encouraged to deploy your own resolved to avoid rate limits and decrease load on my worker.
Deploy
Prerequisites:
- Enable Cloudflare Workers in your Cloudflare account
- Install Bun
- Clone this repository
- Install dependencies using
bun install
- Run
bun cf-typegen
to generate files for the worker - Run
bun run deploy
to deploy this worker under your Cloudflare Compute service
🌿 Help reduce the environmental impact of data center emissions and waste generated during computation. Switch to "Green Compute" mode in Workers & Pages -> Compute setting
Usage
GET /resolve/:ons
- HTTP 200:
{"ok":true,"sessionId":"05ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}
- HTTP 200:
{"ok":true,"sessionId":null}
- HTTP 400:
{"ok":false,"error":"Invalid ONS"}
- HTTP 500:
{"ok":false,"error":"Internal Server Error"}
Example:
- GET
/resolve/hloth
->{"ok":true,"sessionId":"057aeb66e45660c3bdfb7c62706f6440226af43ec13f3b6f899c1dd4db1b8fce5b"}