Websocket Chat
Links
Built With
Description
End-to-end encrypted, self-hostable, and entirely terminal-native. This chat application cuts out the browser and the bloat, letting users communicate securely through a lightweight NPM package from the comfort of their own terminal. Built on WebSockets and deployable in minutes with Docker.
Motivation
Over the years I've heard a lot about WebSockets and common applications of the technology. I've always thought the real-time nature of WebSockets was neat. I've interacted with WebSockets in my day to day work, but I have never had the opportunity to build out a WebSocket server from the ground up. I decided to create a small personal project to incorporate the tech and provide myself the opportunity to learn more about how WebSockets work under the hood. I've always been drawn to CLI based applications, as well as privacy focused applications. So I decided to intermingle these interests and create a terminal based end-to-end encrypted chat app.
Technical Challenge
The two hardest parts were encryption and distribution. For end-to-end encryption I used Node's built-in crypto module, which meant making decisions about key exchange and message framing before a single byte goes over the wire. Getting that right without a third-party library forced me to understand what encrypted actually means in practice. Docker packaging keeps the server and client environment consistent so anyone can spin up their own instance with a single command.