Making an SSH client the hard way
Blog post from Tailscale
Tailscale has introduced the Tailscale SSH Console, a web-based SSH client that enables users to connect to devices running Tailscale SSH directly from their browsers. This innovation differs from other web-based SSH clients by transforming the browser into a Tailscale client, allowing it to join a tailnet like any other device running Tailscale. The development required porting several components to WebAssembly, including the Tailscale client and an SSH client. To address browser environment challenges, a WebSocket-based solution was implemented for DERP relay communications, enhancing compatibility with the fetch()-based HTTP transport. The Tailscale SSH Console is designed to offer a secure and seamless SSH experience without the need for passwords or public key management, and it integrates with Tailscale's admin console to provide a versatile user interface. Despite initial challenges with binary size, optimizations were made to reduce it, and the project resulted in an open-source WebAssembly client packaged for reuse in closed-source environments. The Tailscale SSH Console aims to provide flexibility akin to a real terminal by using "child" windows for rendering, ensuring the main logic remains in the parent window, which enhances performance and user experience.