Skip to content

SSH Keepalive should be set #14

Description

@voipnorm

In the jsxapi library the ssh keep alive by default is turned off. This is the default of the ssh2 library used by jsxapi. While this is not a big problem if your endpoint goes down gracefully, it is if it suddenly loses network connectivity. Basically your ssh session will just hang as might your nodejs application. If the endpoint comes back on a different ip address for what ever reason your ssh session will never recover meaning having to restart your application to recover your connection. The solution how ever is actual very simple. Just add the keepaliveInterval attribute to the connect object and your good to go. This enables ssh keepalives (in milliseconds). Just ensure you use an integer not a string for the timer. This will then generate a event error at disconnect allowing you to recover your ssh session how ever you see fit.

const xapi = jsxapi.connect('ssh://host.example.com', {
username: 'admin',
password: 'password',
keepaliveInterval: 4000
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions