add a 'client-connect-complete'-type script event
Posted: Wed Oct 16, 2019 11:48 pm
Based on my (quick&dirty) testing & a brief analysis of the source code, it appears that the 'client-connect' script event is triggered after connection / authentication, yet before the client is actually able to send&receive IP traffic. As far as I can tell, there is no specific event that is triggered when the client's connection is fully established & able to be accesible from the server.
In many cases, it would help to be able to initiate some scripted task when the client is finally accesible via the network/tunnel, such as connecting to the client via SSH and performing automated management. This doesn't appear to be possible using 'client-connect', as the client's network configuration hasn't been completed at the point in time when 'client-connect' is called, and the client remains in a sort of 'connection limbo' until the script returns.
As as test, I created a 'client-connect' script that tries to SSH into the client & pull some configuration information from the client. Yet, the script would hang & fail, as the client is not yet 'online' & able to be contacted via the network.
A simple way to achieve this would be via some type of 'client-connect-complete' script that fires when the client's data connection has been fully completed and the client is accessible via the network. Also, this maybe could be setup with some type of option(s) that stipulate whether this event should be fired only on initial connection with the server (after some long timeout period), and/or if it should fired after any subsequent re-connection (such as after a brief disconnect from the server).
However, if there's already a way to achieve this goal, please excuse my ignorance & inform me of the solution. I read through the manual, and didn't see anything specific to what I described above.
Thoughts?
In many cases, it would help to be able to initiate some scripted task when the client is finally accesible via the network/tunnel, such as connecting to the client via SSH and performing automated management. This doesn't appear to be possible using 'client-connect', as the client's network configuration hasn't been completed at the point in time when 'client-connect' is called, and the client remains in a sort of 'connection limbo' until the script returns.
As as test, I created a 'client-connect' script that tries to SSH into the client & pull some configuration information from the client. Yet, the script would hang & fail, as the client is not yet 'online' & able to be contacted via the network.
A simple way to achieve this would be via some type of 'client-connect-complete' script that fires when the client's data connection has been fully completed and the client is accessible via the network. Also, this maybe could be setup with some type of option(s) that stipulate whether this event should be fired only on initial connection with the server (after some long timeout period), and/or if it should fired after any subsequent re-connection (such as after a brief disconnect from the server).
However, if there's already a way to achieve this goal, please excuse my ignorance & inform me of the solution. I read through the manual, and didn't see anything specific to what I described above.
Thoughts?