okfn/gobetween

Name: gobetween

Owner: Open Knowledge International

Description: 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.

Created: 2015-12-06 07:39:13.0

Updated: 2018-04-25 05:05:52.0

Pushed: 2017-02-15 15:19:16.0

Homepage: gobetween.oklabs.org

Size: 10

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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

clone https://github.com/okfn/gobetween.git
install
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:

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.