A simple, lightweight Go proxy server that provides stable access to Strava's global heatmap tiles. It automatically handles the cookie refresh process, and adds the required relaxed CORS headers, making it easy to integrate the heatmap into any web or desktop mapping application.
This application runs as a server that fetches heatmap tiles from Strava on your behalf. It manages the required cookies and automatically refreshes them when they expire. It serves tiles over standard HTTP and can be configured to server tiles over HTTPS.
The primary goal is to provide a stable tile endpoint, like http://localhost:8080/all/blue/{z}/{x}/{y}.png, which can be used in map clients like Leaflet, OpenLayers, gpx.studio or GIS software like JOSM.
There are two primary ways to run this application: using Docker or running a pre-compiled binary.
Steps:
-
Get your personal Strava Session Cookie (Recommended):
- Log in to the Strava website.
- Open your browser's developer tools (usually by pressing F12).
- Go to the "Application" (or "Storage") tab, find the cookies for
www.strava.com, and copy the value of the_strava4_sessioncookie.
-
Run the container: The image will be pulled automatically from GitHub Container Registry. Replace
<your_strava_session_cookie>with the value you copied.docker run -d \ -p 8080:8080 \ -e STRAVA_SESSION_COOKIE="<your_strava_session_cookie>" \ --name strava-proxy \ ghcr.io/lumixen/strava-heatmap-envoy:latest
Pre-compiled binaries for Linux, Windows, and macOS can be found in releases.
Steps:
-
Download the appropriate binary for your operating system and architecture.
-
Get your Strava Session Cookie as described in the Docker instructions.
-
Run the binary from your terminal:
-
Linux / macOS:
STRAVA_SESSION_COOKIE="<your_strava_session_cookie>" ./strava-heatmap-envoy -
Windows (Command Prompt):
set STRAVA_SESSION_COOKIE="<your_strava_session_cookie>" strava-heatmap-envoy.exe
-
Once running, you can access the heatmap tiles at the following URL:
http://localhost:8080/{activity}/{color}/{z}/{x}/{y}.png
Example: http://localhost:8080/all/blue/10/512/341.png
If you are using these map tiles on a website that is served over https://, you must also serve the tiles either from the localhost or over https://. Modern web browsers block "mixed content" from remote hosts - that is, loading http:// resources on an https:// page - for security reasons.
This proxy can serve tiles over HTTPS if you provide an SSL certificate and a private key.
Enabling HTTPS:
-
Generate a self-signed certificate: Run the following command to create a certificate valid for e.g.
192.168.1.100.openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=192.168.1.100"This will create
cert.pemandkey.pemin your current directory. -
Run the application with HTTPS enabled: Set the
CERT_PEMandKEY_PEMenvironment variables to the paths of the files you just created.-
Docker:
docker run -d \ -p 8080:8080 \ -p 8443:8443 \ -v $(pwd)/cert.pem:/config/cert.pem \ -v $(pwd)/key.pem:/config/key.pem \ -e CERT_PEM="/config/cert.pem" \ -e KEY_PEM="/config/key.pem" \ -e STRAVA_SESSION_COOKIE="<your_strava_session_cookie>" \ --name strava-proxy \ ghcr.io/lumixen/strava-heatmap-envoy:latest
-
Local Binary (Linux/macOS):
CERT_PEM="cert.pem" KEY_PEM="key.pem" ./strava-heatmap-envoy
-
Your tile URL will now be available over HTTPS, for example: https://192.168.1.100:8443/all/blue/10/512/341.png. You should accept the risks, obviously.
This proxy includes an experimental feature to generate tiles for zoom levels that are not natively available from Strava. For example, if you request a tile at zoom level 19 and the highest available tile is at zoom level 15, the proxy will fetch the level 15 tile and upscale it to generate the requested tile.
This is useful for viewing the heatmap at high zoom levels where Strava does not provide data in apps that don't have a good native upscaling mechanism.
To enable this feature, set the ENABLE_SCALING environment variable to 1 or true.
The application is configured using environment variables:
| Variable | Description | Default | Required |
|---|---|---|---|
STRAVA_SESSION_COOKIE |
Your _strava4_session cookie value from strava.com. If not set, a hardcoded fallback is used. |
No | |
HTTP_PORT |
The port for the HTTP server. | 8080 |
No |
HTTPS_PORT |
The port for the HTTPS server. | 8443 |
No |
CERT_PEM |
Path to the SSL certificate file (.pem or .crt). Enables HTTPS if set along with KEY_PEM. |
No | |
KEY_PEM |
Path to the SSL private key file (.pem or .key). Enables HTTPS if set along with CERT_PEM. |
No | |
LOG_DEBUG |
Set to 1 or true to enable verbose logging of served tiles. |
false |
No |
ENABLE_SCALING |
Set to 1 or true to enable upscaling of missing tiles from lower zoom levels. |
false |
No |
To build the project yourself, you need Go installed.
-
Build a single binary:
go build . -
Build for all target platforms: The scripts/build.sh script cross-compiles binaries for multiple platforms and places them in the
build/artifactsdirectory../scripts/build.sh