ProductPromotion
Logo

Node.JS

made by https://0x3d.site

GitHub - markelog/adit: SSH tunnels – in any way you want it
SSH tunnels – in any way you want it. Contribute to markelog/adit development by creating an account on GitHub.
Visit Site

GitHub - markelog/adit: SSH tunnels – in any way you want it

GitHub - markelog/adit: SSH tunnels – in any way you want it

Adit Build Status Coverage Status

Forward all your stuff through ssh tunnel.

There is a lot of examples out there how this could be useful, for example, check out "SSH Tunnel - Local and Remote Port Forwarding Explained With Examples"

Usage

ssh and Adit

$ ssh -L 9000:imgur.com:80 example.com
new Adit('9000:imgur.com:80 example.com'/*, password*/).forward().then(adit => {
  console.log('success');

  adit.close();
});

$ ssh -R 9000:localhost:3000 example.com

new Adit('9000:localhost:3000 example.com'/*, password*/).reverse().then(adit => {
  console.log('success');

  adit.close();
});

Listen for events

let server = new Adit(...);
server.on('ready', ...);
server.on('tcp connection', ...)
server.on('error', ...);
server.on('data', ...);

server.forward(...).then(...);

Thorough

import Adit from 'adit';

let adit = new Adit({
  
  host: `example.com`

  // Everything else is optional
  // username: 'tester' // By default, `USER` environment variable will be used

  // port: 22, // 22 By default
  // Or port range - 
  // port: [22, 23], the first available port of the three will be used

  // Also, see "Authentification strategy" below - 
  // "agent": "path",
  // "password": "pass",
  // "key": Buffer
});

// Or just
let adit = new Adit('example.com');

// `3` - is how many times we want to try to connect, before bailing out */
adit.open(3).then(connection => {
  // At this point we established connection with remote server

  // Forward all connections from **local** server to remote one
  connection.out({
    // from
    host: 'example.com'
    port: 80
  }, {
    // To
    host: 'localhost'
    port: 8080,
    // Or port range - 
    // port: [25, 28], the first available port of the three will be used
  }).then(() => {
    // Forwarding is enabled
  });

  // Forward all connections from **remote** server to local one
  connection.in({
    // from
    host: 'example.com'
    port: 80,
    // Or port range - 
    // port: [25, 28], the first available port of the three will be used
  }, {
    // To
    host: 'localhost'
    port: 8080
  }).then(() => {
    // Forwarding is enabled
  });
}, error => {
  console.error(error);
});

adit.on('error', () => {
  // Report error
});

// Then, after awhile you would want to close it
adit.close();

Authentification strategy

  • If password is defined - use it
  • If agent or key is defined explicitly - use one of them, prioritize the agent
  • If agent or key is not passed - use environment varibles (SSH_AUTH_SOCK for agent)

Note: if key is used, assume it is added without passphrase, otherwise you should use agent

Articles
to learn more about the nodejs concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about NodeJS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory