No-JS web IRC client that uses forms and a persistent HTTP connection

11 points by runxiyu


steinuil

I did something similar a while ago for a yearly stream I help organize, where the chat is on IRC but I wanted to add a "danmaku" (where the chat messages are overlaid on top of the video and fly from left to right when they arrive) option to the stream website, which meant pumping IRC messages to each channel. At first I thought I'd have to use websockets or SSE, but good ol' chunked transfer encoding did the trick.

On the server side we send a response without Content-Length and with Transfer-Encoding: chunked and forward the PRIVMSG as a chunk to each socket, and on the client side we get a response.body.getReader() and on each message we create an HTML element with a CSS animation that makes it scroll across the screen and spawn a timeout to delete it after a couple seconds. Not very fancy but very effective!

jaredkrinke

It’s no longer online, but I similarly made a snake game that used chunked transfer encoding, forms, and CSS. Unfortunately, it didn’t work in Netsurf, Dillo, w3m, or Lynx, which made me sad.

runxiyu

Hmm, although the filesystem-ID-persistence-cookie and the CGI perl script and C communications seem very fragile here, I could imagine a more usable versions of this for FastCGI or just serving HTTP directly, while retaining its (cursed) persistent HTTP poll.

Meta: For the use of the art tag, cf. in particular, stories tagged with both art and satire.