GithubHelp home page GithubHelp logo

bright-spark / gobetween Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okfn/gobetween

1.0 1.0 0.0 41 KB

A simple app for proxying requests with CORS support. Map any domain to any URI as a base path, or, use a dedicated endpoint for proxying any URI.

Home Page: gobetween.oklabs.org

JavaScript 70.54% Makefile 19.12% Dockerfile 10.34%

gobetween's Introduction

GoBetween

Travis Build Status Coveralls

A simple app for proxying requests with CORS support. Map any domain to any URI as a base path, or, use a dedicated endpoint for proxying any URI.

Quickstart

git clone https://github.com/okfn/gobetween.git
npm install
npm start

We've now got a server running. By default, 127.0.0.1 is setup to proxy google.com in the DOMAIN_MAP, and additionally localhost is the BASE_DOMAIN which allows you to use the /pipe/ endpoint to proxy any URI.

Domain

Go to 127.0.0.1:3000/. You should see google.com.

File

Go to localhost:3000/pipe/https://raw.githubusercontent.com/dataprotocols/schemas/master/data-package.json. you should see https://raw.githubusercontent.com/dataprotocols/schemas/master/data-package.json.

Configuration

Domains to proxy are configured via the DOMAIN_MAP environment variable, which is an array of mapping between front facing domains, and the domains or URI paths they proxy.

By default, , is the delimiter symbol (DELIMITER_SYMBOL) for values in this array, and == is the assignment symbol (ASSIGNMENT_SYMBOL).

Here is an example of a real configuration:

  • DOMAIN_MAP: schemas.datapackages.org==https://raw.githubusercontent.com/dataprotocols/schemas/master
  • BASE_DOMAIN: gobetween.oklabs.org

This configuration exposes gobetween.oklabs.org/pipe/{URI_TO_PROXY} as the file proxy, and schemas.datapackages.org serves up whatever files it can find under the https://raw.githubusercontent.com/dataprotocols/schemas/master path.

gobetween's People

Contributors

pwalsh avatar

Stargazers

martin. avatar

Watchers

 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.