Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bfn-proxy

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bfn-proxy

HTTP request proxy middleware for node.js

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

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 (only headers are modified)
  • 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

Keywords

FAQs

Package last updated on 12 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc