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

inject-tunnel-ssh

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inject-tunnel-ssh

Integrate tunnel-ssh without wrapping your existing codebase

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

inject-tunnel-ssh NPM version Dependency Status Coverage percentage

Integrate tunnel-ssh without wrapping your existing codebase

Installation

$ npm install --save inject-tunnel-ssh

Motivation and usage

The injector was build to support almost zero changes to your existing codebase.

Example

In the following example explains the integration (well injection) based on a little mongojs app..

var db = require('mongojs')('tunneltest1.com/test');
db.test.findOne(console.log);

For some we now need a tunnel to connect to the server..

  
    // ---- START INTEGRATION CODE -----
    require('inject-tunnel-ssh')([{
          dstPort: 27017,
          host: 'tunneltest1.com',
          username: 'root'
      }]).on('error',console.log);
    // ---- END INTEGRATION CODE -----
      
    var db = require('mongojs')('tunneltest1.com/test');
    db.test.findOne(console.log);

How it works

The injector is a module wrapping the native node "net.connection" function to inject the tunnel configuration.

Configuration

You can use the same properties as you would use in tunnel-ssh but in form of an array, since you can setup as many host / port combinations as you want. If no localPort is provided, the injector will search for a free one. For more information about the configuration please refer to the tunnel-ssh package.

If you get stuck using the lib please raise an issue or wait until we write a better readme.. ;)

License

MIT © Christoph Hagenbrock

Keywords

FAQs

Package last updated on 23 Oct 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