News for hackers. Stuff that matters.
Re:In protest of the web{*} bulldozer, a response to websock... by bijection on Wednesday May 20, 2020 @05:51PM (#23252323)
> Unlike the rest of the technologies, [Websockets] seems to have somewhat of a purpose — even if it’s been made redundant by things like HTTP/2 streams. ... Give it a few months, and there will be some NodeJS fad where everyone wants to re-implement HTTP with WebSockets, and load every asset for their website through JavaScript to save a tenth of a microsecond in some edge case involving tech buzzword bingo. ... Once this happens, disabling WebSockets breaks the internet.

To be fair to Websockets, they've been around for almost a decade, pre-dating http/2 by a few years, and the duplex communication they offer is a fundamental building block for all kinds of stuff, from games to trading websites to chat systems.

Although the Battery API is a different story, the author's point about Websockets seems to be based on somehow having overlooked them for quite a while.

Re:In protest of the web{*} bulldozer, a response to websock... by TazeTSchnitzel on Wednesday May 20, 2020 @05:57PM (#23252409)
Yes, and WebSockets are a clean and fast replacement for horrible hacks that preceded them. Nobody liked having to constantly poll the server one way or another, or god forbid, use Flash.
Re:In protest of the web{*} bulldozer, a response to websock... by Thorrez on Thursday May 21, 2020 @12:15AM (#23254730)
One alternative to repeated polling or Flash is hanging GETs. But yes, that's a pretty weird hack.
Re:In protest of the web{*} bulldozer, a response to websock... by cygx on Thursday May 21, 2020 @02:49AM (#23255532)
That's called 'long polling'. You can also leverage HTTP 1.1 chunked transfers. Cf https://en.wikipedia.org/wiki/Comet_(programming)
Re:In protest of the web{*} bulldozer, a response to websock... by arantius on Thursday May 21, 2020 @01:13PM (#23261319)
That's unidirectional. Websockets allow fully stateful bidirectional data transfer (just like a regular socket). They're wonderful when that's what you need.
Re:In protest of the web{*} bulldozer, a response to websock... by Thorrez on Thursday May 21, 2020 @09:22PM (#23267751)
Yeah, you pair hanging GETs with XHR to get bidirectional transfer. Yeah I agree websockets are a lot easier than the hacky hanging GETs + XHR setup.