Remote website access proxy
Latest commit de61cdd Jun 26, 2016 @walac walac committed on GitHub Merge pull request #5 from kristelteng/add_docs_to_whitelist
add docs.taskcluster to whitelist
Failed to load latest commit information.
.babelrc Initial revision. Feb 18, 2016
.gitignore Initial revision. Feb 18, 2016
.travis.yml Add travis-ci configuration. Mar 23, 2016
LICENSE Initial revision. Feb 18, 2016
Procfile Setup heroku app. Feb 18, 2016
npm-shrinkwrap.json Add npm-shrinkwrap Apr 21, 2016
server.js add docs.taskcluster to whitelist Jun 26, 2016

CORS Proxy

cors-proxy is a simple service to enable taskcluster frontend services to make access remote endpoints that disallow cross origin requests.

Any website under domain can make remote requests through cors-proxy.

Making a request

cors-proxy exposes the /request endpoint. You make a POST request to this endpoint and in the request body, you pass the remote website request parameters, in json format.

  url: '',
  method: 'POST',
  contentType: 'application/json',
  data: {
    url: '',
}).done(function(res) {

The request accepts the following parameters, from which only url is required.

Paramater Description
url Remote URL to connect to
method One of the http standards verbs
headers Additional http headers to send
data Body text
rejectUnauthorized Reject if the https certifcate is not valid. Default: true.

Exposing headers

By default, the browser allows Javascript code access to only a small set of response headers. If you want to access one or more headers denied by default, you can use the X-Cors-Proxy-Expose-Headers header. You set it to the list of headers you want to access, separate by comma. On response, the cors-proxy will set the Access-Control-Expose-Headers header with the list you passed.