wabac-cors-proxy v0.1.0
wabac.js CORS Proxy
This provides a simple CORS proxy, which is designed to run as a Cloudflare Worker.
This system is compatible with wabac.js-based tools, including ArchiveWeb.page and ReplayWeb.page
Custom Headers and Status
Redirect
The proxy is designed to be usable with regular browser fetch().
Since fetch does not handle redirect requests, the proxy wraps any 3xx response and returns a 200 response with the headers set:
Response headers:
x-redirect-status- redirect status codex-redirect-statusText- redirect status textx-orig-location- value ofLocationheader
Cookies / Referer
The proxy also handles custom cookie headers, in case they are not sent/filtered out, such as in service workers
Request header:
x-proxy-cookie- passed asCookieheader to upstream server.x-profy-referer- passed asRefererheader to upstream server. TheOriginheader is also updated based on value of referer, if it exists.
Response header:
x-proxy-set-cookie- returned from upstreamSet-Cookieheader in case it gets filtered out.
Usage
Note: CloudFlare wrangler cli tool is required. To login, use wrangler login to login to your Cloudflare Account.
Set the
CORS_ALLOWED_ORIGINSto a list of allowed urls, or set to null to allow any origin.Deploy with
wrangler publish
3 years ago