Cnily03 / cf-worker-mirrors

Proxy to another HTTP connection via cloudflare workers, including Docker Hub, Github.
MIT License
8 stars 8 forks source link
cloudflare-worker docker-proxy dockerhub-mirror github-proxy mirror proxy-server

Cloudflare Worker - Mirrors

This is a Cloudflare Worker that mirrors to another HTTP connection.

Deploy to Cloudflare Workers

Supported sites

Getting Started

Installation

Run the following command to install dependencies:

bun install

Other package managers can be used as well.

To start a development server, run:

bun run dev

Or to deploy to Cloudflare Workers, run:

bun run deploy

Configuration

Create file .dev.vars at the root of the project and add the following content:

SIGN_SECRET="<your secret>" # This is the secret key for signature

For more information about secrets, please refer to Secrets - Cloudflare Workers docs.

Modify environment variables in wrangler.deploy.toml to match your configuration.

# The version of your worker
VERSION = "2.0.0"
# This is the identifier of your worker service
SERVICE_NAME = "cf-worker-mirrors"
# Subdomains will be matched based on this value
# i.e. For docker, the subdomain will be `docker.example.com`
DOMAINS = ["example.com"]
# Convert `text/html` Content-Type to `text/plain` on fallback proxy
FORBID_HTML = true

License

CopyRight (c) Cnily03. All rights reserved.

Licensed under the MIT License.