Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
custom logic for node-http-proxy to proxy basedon incoming url
branch: master

This branch is 4 commits behind dominictarr:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
index.js
package.json
readme.markdown

readme.markdown

proxy by url

this is a simple example of a node-http-middleware that will proxy based on the incoming url. say you want to proxy every request thing under /database to localhost:5984 (couchbd) (and remove the /database prefix)

this is how:

require('http-proxy').createServer(
  require('proxy-by-url')({
    '/database': { port: 5984, host: 'localhost' },
  })
).listen(8000)
Something went wrong with that request. Please try again.