A lightweight proxy server in Docker to fetch, rewrite, and serve remote text files (e.g., .m3u) using regex replacements.
The proxy rewriter can be configured through a config.yaml file, which defines the file mappings and regex replacements.
- Create a
config.yamlfile with your desired mappings and regex patterns:
file_mappings:
file1.m3u:
backend_url: "https://example.com/playlist.m3u"
regex_patterns:
"old-domain.com": "new-domain.com"
file2.m3u:
backend_url: "https://example.com/another_playlist.m3u"
regex_patterns:
"old-server.com": "new-server.com"- Run the Docker container with the config.yaml file mounted as a volume:
docker run -d -p 8000:8000 \
-v /path/to/config.yaml:/app/config.yaml \
ghcr.io/chiva/proxy-rewriter:latestThis will run the proxy server and load the configuration from the config.yaml file.
Access the proxy via:
http://localhost:8000/file1.m3u
http://localhost:8000/file2.m3u
This project uses GitHub Actions to build and push the Docker image to the GitHub Container Registry (GHCR) when a tag is pushed.