Small HTTP proxy that adds permissive CORS headers to public responses
tabs readme: say where the demo lives 4e1c9a7 | ||
|---|---|---|
| cmd/ | move main out of the root | 3 years ago |
| internal/relay/ | follow redirects ourselves, check every hop | 2 years ago |
| web/ | demo page: form posts to the right place now | 2 years ago |
| .gitignore | first commit | 4 years ago |
| Dockerfile | smaller image | 2 years ago |
| LICENSE | first commit | 4 years ago |
| README.md | readme: say where the demo lives | 14 months ago |
| go.mod | bump | 2 years ago |
buildpassinglicenseMITdemoup
Single-binary relay for local development and static front ends.
This is the public demo instance, running the main branch at codetabs.dev. Use it for what you like;
if you depend on it, run your own.
codetabs-proxy: fetch any web address from here, with CORS headers on the answer
The answer as it came, status and headers included:
curl 'https://www.codetabs.dev/v1/proxy?quest=https://httpbin.org/anything/fetch-me'
Your method, headers and body are passed on:
curl -X POST -H 'Content-Type: application/json' -d '{"a":1}' 'https://www.codetabs.dev/v1/proxy?quest=https://httpbin.org/anything/post-me'
From a web page:
fetch('https://www.codetabs.dev/v1/proxy?quest=https://httpbin.org/anything/fetch-me').then(r => r.text())
httpbin.org in these examples is a public test service that answers with a description of the request it got.
http and https only. Redirects are followed. No key, no account.
docker build -t codetabs-proxy . docker run -p 8080:8080 codetabs-proxy
Configuration is by environment variables. They are listed in docs/config.md, which does not exist yet.
MIT