Forked from https://github.com/dommmel/cloudflare-workers-basic-auth and add simple reverse proxy
Never create reverse proxy on Cloudflare Workers without auth protection!
- Services without auth may be abused, and then lead to your CloudFlare account being locked.
- Use this project to protect your proxy behind http-basic auth.
- Set secrets and target host name in
index.js
const SECRET = "your-secret"; // Set your secret key here
const HOST_NAME = "target-website.com"; // Set target website you want to proxy here
- Save and copy
index.js
to your CloudFlare worker, then deploy - Visit
https://your-secret@xxx.workers.dev
to pass http-basic auth and access target website through proxy