-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reconnection to local server if the connection is lost #6
Conversation
@@ -52,6 +52,9 @@ const { argv } = yargs | |||
.option('request-secure-tunnel', { | |||
describe: 'Requests tunel server to create secure tunnel if it is available.', | |||
}) | |||
.option('local_max_reconnect_count', { | |||
describe: 'Max number of reconnection retries to local server if it goes offline.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add default here please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/TunnelCluster.js
Outdated
remote.end(); | ||
|
||
if(self.localReconnectionRetryCount < localReconnectionMaxRetryCount) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep styles consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, fixed.
If a local server tends to close connections for some reason (e.g. inactivity timeout), tunneling client shuts down a tunnel event if a local server is operational.
The fix allows the client to try to reconnect to local server a few times if the connection is lost.