WebRTC: The Painful Love Story Part 2 💔
How I Recovered from Signaling Trauma
“Hi, my name is Kahnu… and I thought I could build a real-time app without crying.”
– Opening line of every WebRTC support group meeting
🎭 Act I: The Diagnosis
I was young. Naive.
I wanted a peer-to-peer Tic Tac Toe game.
But instead of "Chhaki Suna",
I got:
- 😵💫
null
connections - 🫥 Ghost ICE candidates
- 🫠 Console logs that said “success” while nothing worked
It started with:
const peer = new RTCPeerConnection();
And ended with:
Why are we even here.
🧠 Symptoms of WebRTC Trauma
✅ Constant refresh button smashing
✅ Whispering "why is my peer not connecting" at 2AM
✅ Believing TURN servers are mythical creatures
✅ Questioning all life choices after debugging STUN
WebRTC devs don’t debug.
We bargain with the universe.
Act II: Group Therapy Begins🪑
I joined a support group:
"Developers Recovering From RTC" (DRFRTC)
We sat in a circle.
One guy hadn't spoken since his ontrack
handler ghosted him in production.
Another girl tried to implement SFU by reading MediaSoup docs without coffee. She twitches every time someone says “SDP”.
My turn came.
Me:
“I just wanted to play Chhaki Suna with a friend…”
Group (in unison):
“We all did.”
Flashbacks
- That time the ICE candidate arrived after the peer disconnected
- When I forgot to implement signaling and stared at two tabs like “Connect already!”
- When the camera worked, but the mic captured only silence… my silence.
“Have you tried using Firebase for signaling?” Yes. I used Firebase. I also used prayer. Neither helped.
Act III: Healing Begins 🧘
I accepted the truth:
- WebRTC is a protocol, not a promise.
- “Real-time” doesn’t mean “real-easy.”
- It’s not me. It’s literally the NAT traversal.
Then I did the bravest thing: I drew a diagram. Three arrows, one STUN server, a few tears.
Then it clicked:
Signaling != WebRTC
WebRTC != Backendless
TURN != Magic Button
😌 Recovery Plan
1. Breathe deeply
Don’t let
peerConnection.setRemoteDescription()
set off your anxiety.
2. Use console logs... wisely
Not 900
console.log("here")
lines. Just maybe... 899.
3. Have a backup plan
If WebRTC fails, fall back to writing poetry. Or WebSockets.
4. Celebrate small wins
If both peers just show each other’s forehead, that’s progress.
Funny Things I Now Say in Therapy
- “STUN and TURN? More like STUN and BURN.”
- “My relationship with ICE is colder than the actual network.”
- “I don’t use GitHub stars. I use GitHub scars.”
WebSockets – The Therapist I Never Knew I Needed
"He didn’t offer STUN servers. He didn’t ask for ICE candidates. He just... listened. In real time." – Kahnu, post-WebRTC detox
Enter WebSockets – The Chill Wizard
Then someone whispered in a Discord forum:
“Why not just... use WebSockets?”
My eyebrows raised. My trauma flinched. My terminal sighed.
I gave it a try.
⚙️ Chapter 2: Setting Up Was... Too Easy?
npm install ws
Me: “Wait, that’s it?”
Then a basic server:
const WebSocket = require("ws");
const wss = new WebSocket.Server({ port: 8080 });
wss.on("connection", (ws) => {
ws.on("message", (message) => {
wss.clients.forEach((client) => {
if (client !== ws && client.readyState === WebSocket.OPEN) {
client.send(message);
}
});
});
});
NO TURN?
NO STUN?
NO SACRIFICE TO THE INTERNET GODS?
It. Just. Worked.🧘
I opened two browser tabs.
They connected.
One played "X", the other played "O".
Moves synced instantly.
No console error. No ghosting. No trauma.
“You good?”
– WebSocket
“Yeah. Are you… reliable?”
– Me
“Always.”
– WebSocket
Flashback Comparison 💔
Feature | WebRTC | WebSockets |
---|---|---|
Setup Time | 4 hours + a TED talk | 10 minutes |
ICE Candidates | Required | LOL what is that |
Signaling Server | Needed and confusing | Built-in and chill |
Number of Tears | Ocean | Minor eye mist |
Suitable for Games | Not ideal for turn-based | Perfect match ❤️ |
Chapter 4: Kahnu Wins at Last 🏆
I called a friend - Sipun.
We played Chhaki Suna in real time.
He beat me, but I didn’t care.
The app worked.
My console logs were silent.
My laptop fan was silent.
My soul was... calm.
I even deployed it.
And named the repo:
chhaki-suna-ws-final-final-fixed-v7
🧠 Life Lessons from WebSockets
- Not everything has to be peer-to-peer rocket science.
- Simple problems sometimes have simple answers.
- Always check if WebSockets can do it before summoning WebRTC demons.
- You don’t have to suffer to be a real dev 😌
🐣 Bonus: Kahnu’s Real-Time Architecture Starter Pack
Use Case | Use WebRTC? | Use WebSockets? |
---|---|---|
Video Call App | ✅ | ❌ |
Voice Chat | ✅ | ❌ |
Multiplayer Game | 🤨 Meh | ✅ |
Live Chat | ❌ | ✅ |
Chhaki Suna 🥇 | ❌ | ✅✅✅✅✅ |
Final Words 💌
To all devs out there: If you’re struggling with ICE, TURN, SDP, and feel like you're debugging your life...
There’s hope.
There’s WebSockets.
And there’s me – Kahnu – living proof that Chhaki Suna can be won.
Not just on the board, but in life.
Brought to you by Kahnu, proud survivor of the WebRTC wars, and champion of Chhaki Suna dreams.