DEV Community

Realsafe
Realsafe

Posted on

I built RealSafe: An open-core, zero-server WebRTC engine with native E2EE (~18 KB)

Hey everyone! πŸ‘‹

I'm excited to share RealSafe β€” an open-core, zero-dependency WebRTC engine written in pure TypeScript (~18 KB). It is architected from the ground up to solve two of the biggest headaches in modern real-time apps: runaway server egress bills and centralized data storage liabilities.

The Problem with Centralized Media Architectures

Most modern real-time communications platforms (Twilio, Agora, Sendbird) route every single audio stream, video frame, and file through their centralized server origins:

Insane Egress Bills: As your active concurrent users scale, bandwidth costs compound exponentially.
Privacy & Regulatory Liability: Storing or proxying sensitive files and media on cloud origins exposes you to massive compliance risks (HIPAA, GDPR, SOC-2).
How RealSafe Solves It

RealSafe establishes direct, hardened peer-to-peer pipelines between browsers and devices:

πŸ” Client-Side W3C SubtleCrypto E2EE: Ephemeral ECDH P-256 key agreement + AES-256-GCM cipher with 128-bit MAC. Data is encrypted and decrypted strictly inside the client's memory. Signaling servers never touch decryption keys.
πŸ“¦ Zero-Storage P2P File Streaming: Multi-gigabyte files stream directly over 32 KB SCTP DataChannels with adaptive backpressure and end-to-end SHA-256 integrity validation ($0.00 cloud storage egress).
🌐 Resilient Multi-Tier NAT Traversal: Combines Host, STUN, and automatic fallback to TURNS over TLS Port 443 to penetrate restrictive mobile carrier CGNATs (Jio 5G, Airtel 4G) and corporate firewalls.
πŸŽ₯ Zero-Glare Media Switching: Instant camera flips via replaceVideoTrack and screen sharing without renegotiation lockups.
πŸ§ͺ Test the Live 2-Way Interactive Lab

You can test the engine right now across two browser tabs or between your mobile phone and desktop with zero setup:

πŸ‘‰ Live Testing Lab: realsafe-web.vercel.app/lab

Official Website & Technical Architecture:
πŸ‘‰ realsafe-web.vercel.app

Feedback Welcome!

I'd love your brutal technical feedback:

How does the connection stability feel on your cellular or corporate network?
Thoughts on our SCTP backpressure chunking architecture?
What features would you like to see next in the SDK?

Drop your thoughts in the comments below! πŸ‘‡

Top comments (0)