Skip to content

timkurvers/redota-replay-proxy

Repository files navigation

ReDota Replay Proxy

Node Version

Cloudflare worker proxy for Valve Dota 2 replays.

Background

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.

Setup & Development

Written in ES2020+ and published as a Cloudflare worker using wrangler.

  1. Clone the repository:

    git clone git://github.com/timkurvers/redota-replay-proxy.git
  2. Download and install Node.js 12+ for your platform.

  3. Install dependencies:

    npm install
  4. Run the worker locally on http://localhost:8787 which automatically monitors source files:

    npm run start:dev

Publishing

To publish the worker to Cloudflare, complete these additional steps:

  1. Run npx wrangler login and authenticate with Cloudflare.

  2. Copy .envrc-sample to .envrc and set its CF_ACCOUNT_ID to the Cloudflare account that will own the worker.

  3. Source / load .envrc, either manually:

    source .envrc

    Or let direnv do it for you automatically.

  4. Configure wrangler.toml.

Then, to publish a new version, simply run:

npm run publish