You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
});
The text was updated successfully, but these errors were encountered: