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

balboa

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balboa

Simple, fully programmatic, HTTP/S forward proxy

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

balboa Build Status NPM

Simple, programmatic and hackable node.js HTTP forward proxy built-on-top of rocky.

Not designed for serious things, only for playground/development purposes.

Features

  • Dead simple to set up
  • Acts like a traditional HTTP forward proxy (e.g: Squid)
  • Supports HTTP interceptors to modify request/response payloads
  • Programmatically hackable (see rocky API)
  • Command-line interface

Whish list

  • Full HTTPS support (forward TLS peer certificate)

Installation

npm install -g balboa

For programmatic usage only install it in your dependency tree:

npm install balboa --save

Usage

Start the forward proxy:

balboa -p 8080

Then you can configure your web browser to use balboa as proxy (Firefox proxy settings below):

Finally, try browsing some site.

Programmatic API

Simple programmatic set up of an HTTP proxy to sniff and transform HTML metadata:

const balboa = require('balboa')
const proxy = balboa()

proxy
  .route
  .transformResponseBody(function (req, res, next) {
    if (/html/i.test(res.getHeader('content-type')) === false) return next()

    var body = res.body.toString()
    // Compose the new body
    var newBody = body.replace(/<body(.*)>/, '<body$1><h1>HELLO WORLD</h1>')
    // Set the modified body
    next(null, newBody, 'utf8')
  })

proxy.listen(8080)
console.log('Proxy server listening on port:', 8080)

balboa([ opts ]) => rocky

Creates a new HTTP or HTTPS proxy.

Supported options

See rocky docs for full supported options.

balboa.proxy([ opts ]) => rocky

Creates an HTTP proxy.

balboa.proxySSL(opts) => rocky

Creates a SSL proxy with the given options. See an example here.

balboa.VERSION

Current package version

balboa.rocky

Rocky proxy. See full API docs here.

License

MIT - Tomas Aparicio

Keywords

FAQs

Package last updated on 11 Jan 2016

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