Giter VIP home page Giter VIP logo

proxies-on-cloudflare's Introduction

proxies-on-cloudflare

Makes it easy to build Cloudflare Workers, by providing high-level proxying primitives addressing common needs.

Installation

$ yarn add proxies-on-cloudflare

Features

  • Built-in proxies for
    • Firebase (Hosting & CloudFunctions)
    • Mixpanel
  • Simple routing via quoi (providing a familiar express-like API)
  • One-liner proxies (e.g: proxy.to('https://upstream.com/'))
  • Loadbalancing (roundrobin, random, iphash, ...)
  • Fallback and error handling

Example

import { quoi, firebase, proxy }  from 'proxies-on-cloudflare';
import { hosting as hostingConfig } from './firebase.json';

// Init firebase proxy
const fbase = new firebase('gitbook-staging', hostingConfig);

// Route and listen
const app = quoi();
app.domain('app.gitbook.com').serve(fbase);
app.domain('test.gitbook.com').serve(proxy.to('https://test.github.io/test/'));
app.domain('storage.gitbook.com').serve(proxy.roundrobin(['https://server1', /* ... */ ]));
app.listen();

You can see a more complex (real-world) example in _examples/gitbook/

Why ?

We 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.

proxies-on-cloudflare's People

Contributors

aarono avatar jpreynat avatar samypesse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.