Hacker News new | ask | show | jobs
by mattjaynes 1296 days ago
Somewhat related...

On Wireguard's homepage[1] it says "[Wireguard] is even capable of roaming between IP addresses, just like Mosh. There is no need to manage connections, be concerned about state, manage daemons, or worry about what's under the hood."

Has anyone been using Wireguard as a successful Mosh replacement? Would love to hear your experience.

[1] https://www.wireguard.com/

Edit: added link

4 comments

It kinda works, but mosh reconnects on failure regardless of how long time has passed. Since WG is a layer below, the TCP connection eventually gets reset. It is a huge difference. Also mosh works around lag by local echo, no such thing in WG.
Why local echo is useful?

If I'm expecting echo, it does not add anything useful to my experience. I'm not waiting for every typed character to appear on my screen before I type next one.

If I'm expecting data from the server (say I'm searching through shell history), it might even make my experience worse because of flickering between local and then remote state.

I'm regularly working with 100-200 ms latency servers where latency is noticeable. Improving my perceptual latency was never something I want.

Better approach is to use client/server software. Like vscode. Of course it's out of capabilities of terminal emulator and rather requires full rethinking of the entire shell architecture. But at least it would be meaningful improvement. Like I'm typing first character in shell history search, server transfers all 100 matched lines to the client and now my client can further filter this list without any server hops.

It doesn't really fully replace mosh since it doesn't do any of the perceptual lag reduction, but I do use SSH over Wireguard and it is fairly stable. It can indeed survive roaming.
I use ZNC over wireguard and it works fairly well! I can travel in the car with my phone connected to IRC, roam from my home WiFi to the cellular network and back without disconnecting from ZNC! It even works pretty well when cellular service is spotty.

This isn't quite what you asked but I think it's relevant!

Try looking at options ServerAliveInterval and TCPKeepAlive, they should prevent SSH from detecting when there's temporary transport issues and persist when wireguard roams between IPs.