proxytable

1.0.1 • Public • Published

proxytable

Proxy table for http-proxy

 
var http = require('http')
 
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy()
var proxytable = require("proxytable")
var routes = proxytable()
 
// arguments:
// host - String | Function(req, res)
// target - String
// host can be a glob pattern like "*.example.com"
routes.proxy(proxytable.IP, proxytable.target(8001))
 
http.createServer(function(req, res) {
  proxy.web(req, res, {
    target: routes.findTarget(req)
  })
}).listen(80, proxytable.IP, function(  ){
  console.log("hello")
})
 

Readme

Keywords

Package Sidebar

Install

npm i proxytable

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • tunderdomb