skywire icon indicating copy to clipboard operation
skywire copied to clipboard

Reconnect logic for VPN & proxy clients

Open 0pcom opened this issue 1 year ago • 2 comments

Sometimes the proxy or vpn client will get disconnected for a moment, at which point the client will simply stop.

However, if one attempts to establish the connection again, often it is possible to quickly re-establish the transport and the connection to the proxy or vpn server by simply attempting to start the app again.

We should consider retry logic for such instances ; configurable via flag and / or a field in the visor config for that app. ... Additionally, sometimes when starting the proxy or VPN clients, they are simply not going to start. In this instance, there is no way to cancel the retry loop that the visor gets stuck in.

0pcom avatar Apr 06 '24 15:04 0pcom

to address this issue I suggest the following

  • flag to create a transport of the specified type to the specified key via vpn / proxy start before starting the proxy or vpn
  • a flag to specify the number of retries on connection errors - I.E. after the connection is successfully established - or retry n times and if n == -1 it's unlimited retries... n==0 would be the same as the default behavior, no retries.

the retry loop is encountered when attempting to establish a connection that isn't going to work. That needs a global setting, I think, possibly a config setting. Because it might be difficult to insert the logic otherwise.

0pcom avatar Jun 29 '24 14:06 0pcom

List of tasks for handle this issue:

  • [ ] add field to transport creating data, like "app", that could be empty, but if was not empty, then each time check the app was not shutdown or something else. If it was shutdown, then cancel transport creating
  • [ ] add label for transport, if is related to app, and point to which app, like app:vpn-cleint for example
  • [ ] flag for retries on suddenly close connection, except close signal Ctrl+C
    • 0 : no retry
    • -1 : unlimited try
    • any positive number, like 3 as default value : number of retries

mrpalide avatar Jun 30 '24 11:06 mrpalide