Skip to content

openpodcast/forwarder

Repository files navigation

Edge worker

The forwarder is the part of the Open Podcast platform which RSS feeds and replaces mp3 links with a custom URL on the fly. We don't use a full RSS parser yet as we could run into a lot of edge-cases. Instead, we just extract the URLS with a regex and replace them.

Usage

Run make help for a full list of commands.

# compile project to WebAssembly
make build

# run Worker in a development environment
wrangler dev

# deploy Worker to Cloudflare
wrangler login
wrangler publish

# test request
curl -A "Spotify/1.0" -c - https://forwarder.mre.workers.dev

Worker Config

To deploy different workers you can change the path to the wrangler config with

CONFIG=wrangler-redcircle.toml make deploy

Implementation steps

  1. RSS feed edge worker replaces <enclosure url="URL" ... /> elements by new URL of edge worker with the original URL encoded. Important: URLs have to end with .mp3
  2. requests are forwarded to original url by edge worker

Matomo Instance for Testing

Instance URL: https://piwik.inlupus.at/matomo.php?idsite=15&rec=1

Matomo API Docs

RSS Examples

Resources