I vaguely remember there was a cool hack with some part of a website being served by a server that just never signals end of file, and adds new content to it in a streaming fashion...
-
I vaguely remember there was a cool hack with some part of a website being served by a server that just never signals end of file, and adds new content to it in a streaming fashion... in a way that the web browser isn't aware of but it still happens to work... doea anyone remember what that was?
-
@wolf480pl Are you perhaps thinking of chunked encoding?
There's a reasonable explanation (and example!) here.
Only works in HTTP/1.1, HTTP/2 has its own mechanism for data streaming.
-
@algernon no, I mean on a higher level.
Chunked encoding is one of the ways to drliver a response incrementally.
The browser makes several types of http requests that are not initiated by JS - requests for img src, for stylesheets, for the html document itself, etc.
Which of those accidentally support incremental responses, and who was the first to abuse it as a way to send server-initiated content changes?
-
@wolf480pl Ah, I see. I seem to recall sites back in the late 1990s abusing animated gifs and chunked encoding to replace images on server-initiated events. They simply sent a new frame then.
Is this the kind of thing you're looking for?
-
@algernon yup, but I think in the last couple years I saw someone (re)discover this technique and use it to append HTML...
-
@wolf480pl FWIW, https://lwan.ws/ has a live example:
(I wonder how that embeds?)
And yeah, same can be used for HTML, and now that you mention it... I do recall someone very recently doing just that, in a very crazy way. I'll see if I can find it!
-
Gergely Nagy 🐁replied to Gergely Nagy 🐁 last edited by
@wolf480pl Hrm, the example I was thinking of ended up being wrong (it used webasm, and was mostly client side, not server initiated). I did find this though, which might be interesting. No JS involved, but it does rely on modern tech (shadow dom) that wasn't available way back when.
As in, this not only appends stuff to the page, but can load stuff out of order, without javascript, controlled by the server.