bfn-proxy

Boot Fidelity NodeJS-Proxy

Showing:

Popularity

Downloads/wk

95

GitHub Stars

8

Maintenance

Last Commit

3yrs ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Readme

bfn-proxy

HTTP request proxy middleware for node.js

NPM Version Build Status Test Coverage

Designed to be the simplest way possible to proxy http calls.

Features

  • Small footprint
  • Responses are unmodified
  • Built for browser use (url-relative/root-relative resources work)
  • Great for testing your website at proxy location
  • Great for grabbing a screen shot of your website from proxy location

Install

$ npm install --save bfn-proxy

Examples

vanilla http server

Simple app. If created on heroku, go to https://applicationname.herokuapp.com/twitter.com/

require('http')
  .createServer(require('bfn-proxy')())
  .listen(process.env.PORT || 8080)

express/connect simple

Simple app using middleware, i.e. http://servername.com/ipecho.net/plain

var express = require('express')
var pxy = require('bfn-proxy')()

var app = express()

app.use(pxy)

express/connect advanced

Only allow access from your local server with URI prefix '/pxy', i.e. http://127.0.0.1/pxy/www.bluefidelity.com/

var express = require('express')
var pxy = require('bfn-proxy')()

var app = express()

app.use('/pxy/', function (req, res, next) {
  if (req.connection.remoteAddress !== '127.0.0.1') {
    return next(new Error('Bad authentication data'))
  }
  pxy(req, res)
})

TODO

  • Improve everything

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Tutorials

No tutorials found
Add a tutorial