{"id":19501124,"url":"https://github.com/gitbookio/proxies-on-cloudflare","last_synced_at":"2025-04-25T23:30:54.556Z","repository":{"id":41783857,"uuid":"153788753","full_name":"GitbookIO/proxies-on-cloudflare","owner":"GitbookIO","description":"Proxies in Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2023-07-12T02:41:11.000Z","size":484,"stargazers_count":92,"open_issues_count":36,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T05:04:30.600Z","etag":null,"topics":["cloudflare-worker","firebase","firebase-hosting"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitbookIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-10-19T13:41:18.000Z","updated_at":"2025-01-25T15:08:50.000Z","dependencies_parsed_at":"2024-01-05T20:58:57.517Z","dependency_job_id":"60cbcbdb-ddcf-4a07-b230-86dde40ab990","html_url":"https://github.com/GitbookIO/proxies-on-cloudflare","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fproxies-on-cloudflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fproxies-on-cloudflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fproxies-on-cloudflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fproxies-on-cloudflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/proxies-on-cloudflare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-worker","firebase","firebase-hosting"],"created_at":"2024-11-10T22:11:15.100Z","updated_at":"2025-04-25T23:30:54.262Z","avatar_url":"https://github.com/GitbookIO.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `proxies-on-cloudflare`\n\nMakes it easy to build [Cloudflare Workers](https://www.cloudflare.com/products/cloudflare-workers/), by providing high-level proxying primitives addressing common needs.\n\n## Installation\n\n```\n$ yarn add proxies-on-cloudflare\n```\n\n## Features\n\n- Built-in proxies for\n    - Firebase (Hosting \u0026 CloudFunctions)\n    - Mixpanel\n- Simple routing via `quoi` (providing a familiar `express`-like API)\n- One-liner proxies (e.g: `proxy.to('https://upstream.com/')`)\n- Loadbalancing (`roundrobin`, `random`, `iphash`, ...)\n- Fallback and error handling\n\n## Example\n\n```js\nimport { quoi, firebase, proxy }  from 'proxies-on-cloudflare';\nimport { hosting as hostingConfig } from './firebase.json';\n\n// Init firebase proxy\nconst fbase = new firebase('gitbook-staging', hostingConfig);\n\n// Route and listen\nconst app = quoi();\napp.domain('app.gitbook.com').serve(fbase);\napp.domain('test.gitbook.com').serve(proxy.to('https://test.github.io/test/'));\napp.domain('storage.gitbook.com').serve(proxy.roundrobin(['https://server1', /* ... */ ]));\napp.listen();\n```\n\nYou can see a more complex (real-world) example in `_examples/gitbook/`\n\n## Why ?\n\nWe originally (GitBook) built `proxies-on-cloudflare` (previously named `firebase-on-cloudflare`) to fix connection issues we had between `Cloudflare` and `Fastly/Firebase Hosting` but have now extended it to solve broad routing needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fproxies-on-cloudflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitbookio%2Fproxies-on-cloudflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fproxies-on-cloudflare/lists"}