Cloudflare PyPI Mirror Worker is a Cloudflare Worker script for setting up a mirror of the Python Package Index (PyPI) using Cloudflare Workers.
This script intercepts requests to the PyPI simple index and files.pythonhosted.org, enabling faster access to Python packages by serving them through Cloudflare's global network.
-
Deploy the Worker: Deploy this script as a Cloudflare Worker.
-
Accessing the Mirror:
- Once the Worker is deployed, requests to PyPI simple index and package files will be redirected through the Cloudflare Worker.
Once deployed and running, you can use pip
as follows:
(Replace 'worker_url.dev' with the actual URL of your worker url .)
pip3 install --index-url https://worker_url.dev/pypi/simple package_name
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.