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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
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.
Go to 127.0.0.1:3000/
. You should see google.com
.
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
.
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.