Skip to content

About

A curated collection of small, focused, and useful Cloudflare Workers Each Worker lives in its own folder and does one thing well.

Topics

Resources

Stars

28 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Workers ● Edge functions ● Zero servers ● Free-tier friendly


# Workers

▎1 TBA ⎋﹕ key-gated proxy to the Telegram Bot API
▎2 CAPTCHA ⎋﹕ self-hosted SVG CAPTCHA with HMAC-signed expiring tokens
▎3 GEO ⎋﹕ request intelligence endpoint — full request.cf + derived fields
▎4 WS ⎋﹕ WebSocket hub with rooms + SQLite-backed chat persistence
▎5 AGGREGATOR ⎋﹕ concurrent JSON fan-out — fetch up to 10 APIs at once
▎6 CORS ⎋﹕ minimal CORS-anywhere proxy with preflight handling


# Deploy with Cloudflare AI

Tip

Paste this into the Cloudflare AI agent and it builds and deploys all six Workers directly to your account, prompts you for the three secrets, wires up the Durable Object for ws, and hands back live URLs with test commands.

Deploy the Cloudflare Workers collection from https://github.com/Kourva/cloudflare-workers to my account.

For each of the 6 Workers (tba, captcha, geo, ws, aggregator, cors):
- Create the Worker script from the repo source
- Set up the required wrangler.toml (compatibility date, bindings, migrations)
- For ws: create the Durable Object binding (MY_DO, class ws) and migration
- Ask me for each required secret value (PROXY_KEY, CAPTCHA_SECRET, ROOM_KEY) and set them
- Deploy each Worker

After deploying, give me the URL for each Worker and a quick test curl command.

# TBA

▎Secrets ⌱ PROXY_KEY
▎Endpoints ⌱ GET / → health check · ANY /<path>?key=<PROXY_KEY> → forwarded to api.telegram.org

cd tba && npx wrangler secret put PROXY_KEY && npx wrangler deploy
curl "https://tba.<sub>.workers.dev/bot<TOKEN>/getMe?key=<PROXY_KEY>"

# CAPTCHA

▎Secrets ⌱ CAPTCHA_SECRET
▎Endpoints ⌱ GET /captcha?type=&theme=&len=&… → { token, type, theme, svg } · POST /verify { token, answer } → { ok, type, theme }
▎Types ⌱ chars (default) · math · sequence

cd captcha && npx wrangler secret put CAPTCHA_SECRET && npx wrangler deploy
curl "https://captcha.<sub>.workers.dev/captcha?type=math" | jq
curl -X POST https://captcha.<sub>.workers.dev/verify -H 'content-type: application/json' -d '{"token":"...","answer":"10"}'

# GEO

▎Secrets ⌱ none
▎Endpoints ⌱ GET / → full request.cf + ip, connectionQuality, rttMs, networkHint, isTorByCf, mtlsPresented, tlsProfile, protocolHint

cd geo && npx wrangler deploy
curl "https://geo.<sub>.workers.dev/" | jq

# WS

▎Secrets ⌱ ROOM_KEY
▎Bindings ⌱ MY_DO (Durable Object, class ws)
▎Endpoints ⌱ wss://<host>/<room>/<action> → WebSocket · GET /<room>/clear → wipe room storage

cd ws && npx wrangler secret put ROOM_KEY && npx wrangler deploy
# browser
const ws = new WebSocket("wss://ws.<sub>.workers.dev/myroom/chat", "<ROOM_KEY>")
ws.send("hello room")

# AGGREGATOR

▎Secrets ⌱ none
▎Endpoints ⌱ GET /?key1=url1&key2=url2… → merged JSON (max 10 pairs)

cd aggregator && npx wrangler deploy
curl "https://aggregator.<sub>.workers.dev/?ipinfo=https://ipinfo.io/json&github=https://api.github.com/zen" | jq

# CORS

▎Secrets ⌱ none
▎Endpoints ⌱ ANY /?target=<url> → proxied response with CORS headers · OPTIONS /?target=<url> → preflight

cd cors && npx wrangler deploy
curl "https://cors.<sub>.workers.dev/?target=https://api.example.com/data"

# License

MIT ● use these however you like.

About

A curated collection of small, focused, and useful Cloudflare Workers Each Worker lives in its own folder and does one thing well.

Topics

Resources

Stars

28 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages