Giter Site home page Giter Site logo

migration from v4 to v5 about tunnel-ssh HOT 5 CLOSED

TakamiChie avatar TakamiChie commented on June 10, 2024
migration from v4 to v5

from tunnel-ssh.

Comments (5)

agebrock avatar agebrock commented on June 10, 2024

Hi @TakamiChie

The configuration is almost the same , just grouped a bit different.

  • dstHost, dstPort goes to the => forwarding options. (in your case srcAddr and srcPort are most likely the same)
  • host, port, username, password are ssh server related +> sshoptions.
  • and localHost and localPort is where your localTCP Server is listening => serverOptions.
  • keepAlive => tunnelOptions (autoClose:false)

Please let me know if that helps . We will update the Readme soon.

from tunnel-ssh.

TakamiChie avatar TakamiChie commented on June 10, 2024

Thanks for the reply.
I wrote the following program in accordance with your point.

const { createTunnel } = require('tunnel-ssh');

const tunnelOptions = {
  autoClose:false
};
const serverOptions = {
  host: localHost, port: localPort
};
const sshOptions = {
  host: host, port: port,
  username: username, password: password,
}
const forwardOptions = {
  srcAddr:host, srcPort:port,
  dstAddr:dstHost, dstPort:dstPort
}
let [[serv, conn], error] = await createTunnel(tunnelOptions, serverOptions, sshOptions, forwardOptions);

However, the following error is displayed when the createTunnel() method is executed.

(node:9252) UnhandledPromiseRejectionWarning: Error: listen EADDRINUSE: address already in use [localHost]:[localPort]
    at Server.setupListenHandle [as _listen2] (node:net:1372:16)
    at listenInCluster (node:net:1420:12)
    at doListen (node:net:1559:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Am I misunderstanding your point?

from tunnel-ssh.

agebrock avatar agebrock commented on June 10, 2024

actually your config looks right. The error indicates that something on the port : localPort is already listening.
As a hint how to find out what is listening you can check the following site maybe it will help you :
https://stackoverflow.com/questions/4075287/node-express-eaddrinuse-address-already-in-use-kill-server

FYI in the 5.0.5 version that error is catchable, this will not solve your issue you can just handle it different.

from tunnel-ssh.

TakamiChie avatar TakamiChie commented on June 10, 2024

Sorry for the late contact.

When the code was simplified as much as possible and the process was executed, the server and client objects were obtained as intended.

We look forward to continuing to update the Readme.

from tunnel-ssh.

agebrock avatar agebrock commented on June 10, 2024

👍 We are trying our best :-)

from tunnel-ssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.