Building a random chat where language doesn't matter: WebRTC, relay as a condition, and live translated captions
The original Omegle proved something for fourteen years: two strangers who would never have met can have a good conversation. It shut down in 2023. What it never solved is the part I kept running into myself — most of the world still can't understand each other. You get matched with someone in São Paulo or Jakarta, you both say "hi", and that's where it ends. So I built Veilr: a random chat —…
Veilr is a random chat application that allows two strangers to communicate in a language they both understand. It started as a desire to solve the issue of language barriers between people who would never have met otherwise. The app is built entirely in the browser and supports text, voice, and video formats. Users can choose from 16 interface languages for the app. The core idea is that the other person should be able to understand you without either of you doing anything.
Text messages are translated if the user's language preference differs from their partner's, but the original message can be viewed with a single tap. Voice and video calls use a streaming speech-to-text pipeline to provide live captions in the listener's language. The captions are generated using a Soniox pipeline and rendered over the call surface.
The app's architecture is simple, with a WebSocket transport that connects clients. Services never interact with the WebSocket directly; instead, they use a WebSocket send or publish function. The relay comes into play when a direct connection isn't available. The architecture involves WS, Redis pub/sub relay, and Postgres for identity and other data. The backend uses Node.js, React for the client, and Capacitor for Android builds.
Veilr's matching system focuses on user preferences rather than filters. It offers a free account with preferences that have timers and an upgraded Boost feature for guaranteed matches. WebRTC negotiation is crucial, and Veilr ensures perfect negotiation by implementing a specific pattern that includes polite peer behavior and graceful handling of renegotiations.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.