Skip to content

About

A reverse-proxy mirror of asmr.one built with Cloudflare Workers.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

asmr.one.mirror

A reverse-proxy mirror of asmr.one built with Cloudflare Workers.

All requests made to the worker are forwarded to asmr.one (HTML / static assets) or the upstream API host (API calls, paths starting with /api/). Domain references inside HTML, JavaScript, CSS, and JSON responses are rewritten on the fly so the site works seamlessly on your mirror domain.

The upstream API is configurable. By default the worker forwards /api/* to api.asmr-200.com (the host the asmr.one frontend actually talks to). It also rewrites references to a configurable list of API aliases (api.asmr.one, api.asmr-100.com, api.asmr-300.com, …) to the mirror, so the browser never makes direct cross-origin calls to them (which would be blocked by CORS).


Features

  • Transparent reverse proxy for both the frontend (asmr.one) and the backend API (configurable, defaults to api.asmr-200.com)
  • Rewrites references to multiple API hostname aliases (api.asmr.one, api.asmr-100.com, api.asmr-300.com, …) so all API calls are routed through the mirror and not blocked by CORS
  • Strips security headers (CSP, X-Frame-Options, etc.) that would otherwise block the mirror
  • Proper CORS support including preflight (OPTIONS) handling
  • Cookie domain rewriting so login sessions work on the mirror

Prerequisites


Quick Start

1. Install dependencies

npm install

2. Log in to Cloudflare

npx wrangler login

3. (Optional) Customise wrangler.toml

Edit wrangler.toml if you want to change the worker name or add a custom domain route:

name = "asmr-one-mirror"        # Worker name shown in the Cloudflare dashboard
main = "src/index.js"
compatibility_date = "2024-01-01"

# Uncomment and fill in to serve the worker on your own domain
# [[routes]]
# pattern = "your-mirror.example.com/*"
# zone_name = "example.com"

4. Run locally for development

npm run dev
# Worker is available at http://localhost:8787

5. Deploy to Cloudflare Workers

npm run deploy

After deployment Wrangler prints the public URL, e.g.:

https://asmr-one-mirror.<your-subdomain>.workers.dev

Opening that URL will load the mirrored asmr.one site.


One-click deploy

Deploy to Cloudflare Workers


Project structure

.
├── src/
│   └── index.js       # Cloudflare Worker entry point
├── wrangler.toml      # Wrangler / Workers configuration
├── package.json
└── README.md

How it works

  1. Every incoming HTTP request is intercepted by the Worker.
  2. If the request path begins with /api/, it is forwarded to https://${UPSTREAM_API_DOMAIN} (default api.asmr-200.com); otherwise it is forwarded to https://${UPSTREAM_DOMAIN} (default asmr.one).
  3. Request headers that could reveal the proxy origin (e.g. CF-Connecting-IP) are stripped before forwarding.
  4. Response headers that would block the mirror (e.g. Content-Security-Policy, X-Frame-Options) are stripped.
  5. For text-based responses (HTML, JS, CSS, JSON), all occurrences of the upstream domain and any API alias listed in UPSTREAM_API_DOMAIN_ALIASES are replaced with the mirror domain.
  6. The modified response is returned to the browser.

Disclaimer

This project is intended for personal and educational use. Please respect the asmr.one Terms of Service and applicable copyright law. The authors of this mirror take no responsibility for how it is used.

About

A reverse-proxy mirror of asmr.one built with Cloudflare Workers.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages