Cloudflare worker proxy for Valve Dota 2 replays.
Valve keeps replay files for public matches, used by both the official client for replay viewing as well as by sites such as OpenDota and Dotabuff to analyze matches in further detail.
Unfortunately, these Valve replay servers are not configured for cross-origin resource sharing and as such cannot be reached by web clients, like ReDota. This project proxies the replay files, making them available with the correct HTTP headers.
Written in ES2020+ and published as a Cloudflare worker using wrangler.
-
Clone the repository:
git clone git://github.com/timkurvers/redota-replay-proxy.git
-
Download and install Node.js 12+ for your platform.
-
Install dependencies:
npm install
-
Run the worker locally on
http://localhost:8787
which automatically monitors source files:npm run start:dev
To publish the worker to Cloudflare, complete these additional steps:
-
Run
npx wrangler login
and authenticate with Cloudflare. -
Copy
.envrc-sample
to.envrc
and set itsCF_ACCOUNT_ID
to the Cloudflare account that will own the worker. -
Source / load
.envrc
, either manually:source .envrc
Or let direnv do it for you automatically.
-
Configure
wrangler.toml
.
Then, to publish a new version, simply run:
npm run publish