Hacker News new | ask | show | jobs
by politician 1695 days ago
Good to know that WebSocket API is broken by design. Thanks W3C!

https://www.w3.org/Bugs/Public/show_bug.cgi?id=13104

2 comments

This is what confused me. The discussion made sense to leave it up to the browser to implement, but I can't understand why they didn't require it in the browser WebSocket implementation — they even suggested it and then forgot about it.
Yes! I was both surprised and confused when I saw this. Unless I'm missing something, it means that every application implementing WebSockets has to reinvent the wheel, creating their client-side ping/pong handler using Data Frames since browsers don't automatically send nor expose an API for sending/acting on Control Frames.