<div dir="ltr"><p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">I have started to work on “Persistent Connections” for Blink with great success! For background, these are the related GH issues (<a href="https://github.com/mobile-shell/mosh/issues/394">https://github.com/mobile-shell/mosh/issues/394</a>) and (<a href="https://github.com/blinksh/blink/issues/59"><span style="color:rgb(228,175,9)">https://github.com/blinksh/blink/issues/59</span></a>).</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">I hacked together - as in I have hardcoded most of the stuff - a simple version that is able to save a session to disk and reconstruct it given the previous key. Turns out it was all a lot easier than I thought, without requiring hardcore object serialisation. States (timestamp, sequence nonce and content) can be dropped to disk as if they were going to be sent over the network, and reconstructing the states to the initial Terminal::Complete and Network::UserStream objects is straightforward with the diff functions. </p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">There is the question of how many states should be saved, from reading the code I guess the answer is all of them, from my test only the latest acked one was enough - but again, crappy test.</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">Another obvious security concern as the states contain information from the terminal in a completely readable format. Could that be encrypted again with the key before saving? In the case of iOS I can save the secure key to the keychain. But I think that on top of that, saving the session with a Passphrase might be a good idea.</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69);min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">I understand that this might only be useful in Blink, but any guidance would be appreciated. In the same manner, if you change your opinion, I&#39;m more than happy to walk the extra mile and make it work for everyone.</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:helvetica;color:rgb(69,69,69)">Thanks a lot!!</p></div>