Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zyrenth/workersreverseproxy
some cloudflare worker proxy
https://github.com/zyrenth/workersreverseproxy
Last synced: 12 days ago
JSON representation
some cloudflare worker proxy
- Host: GitHub
- URL: https://github.com/zyrenth/workersreverseproxy
- Owner: Zyrenth
- Created: 2024-01-14T15:06:21.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-01-20T11:42:22.000Z (12 months ago)
- Last Synced: 2024-01-20T13:36:38.651Z (12 months ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cloudflare Workers proxy
Well, it's literally what you think, you can proxy HTTP/HTTPS requests through Cloudflare's Workers.
# How to use this?
First of all, rename the `wrangler.example.toml` file to `wrangler.toml`.
Then edit the `ALLOWED_TOKENS` env. variable based on your needs, these tokens will allow you to authenticate to this proxy.- If you only need 1 token then just paste it there, no need to add anything else.
- If you need multiple tokens you can separate them with `; ` (the space is required otherwise it won't work).After you've done this you can publish the worker.
If you published your worker you can pull up `Postman` (for example) to test this out. After you've opened Postman make a HTTPS request to your worker:
- Use one of the tokens you set earlier, to authenticate you must use the `X-Authorization` header and not the regular `Authorization` header as that will be forwarded.
- You can specify a URL using the `url` parameter.The following will be forwarded:
- Headers except headers that start with `cf-` or contain `ip` or it's one of the following: `X-Authorization`, `Host`, `Referer`, `Origin`
- The method you used to request the proxy.
- The body of your request.If the proxy returns an error (such as `Unauthorized`, `Forbidden` or `Bad request`) it will have the `X-From-Proxy` set as `true`.