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:8787which automatically monitors source files:npm run start:dev
To publish the worker to Cloudflare, complete these additional steps:
-
Run
npx wrangler loginand authenticate with Cloudflare. -
Copy
.envrc-sampleto.envrcand set itsCF_ACCOUNT_IDto the Cloudflare account that will own the worker. -
Source / load
.envrc, either manually:source .envrcOr let direnv do it for you automatically.
-
Configure
wrangler.toml.
Then, to publish a new version, simply run:
npm run publish