💾 Archived View for rawtext.club › ~sloum › geminilist › 007261.gmi captured on 2021-12-05 at 23:47:19. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
Omar Polo op at omarpolo.com
Mon Oct 4 17:10:27 BST 2021
- - - - - - - - - - - - - - - - - - -
Hello,
One of the things that I love about text/gemini is how it's easy toparse, and being it line-based it's also really easy to stream it. WhenI started working on telescope, the idea of being able to stream contentwas present in the design of the parser from the first draft -- it alsofit nicely with separation in multiple processes (one process does thefetching, another one the rendering, and messages are sent from one procto the other.) But other than knowing from the code that it shouldwork, I never played with this aspect of text/gemini.
Fast forward various months, I've just watched the "Why gemini" video byTomasino and I got an urge to build something with streaming text. I'mattaching a very, very simple CGI script that streams text/gemini tobuild an interactive chatroom.
The idea is similar to the one presented by solderpunk in "A vision forgemini applications"
gemini://gemini.circumlunar.space/users/solderpunk/gemlog/a-vision-for-gemini-applications.gmi
and, frankly, I'm quite disappointed nobody has built something likethis before. (or at least I haven't been able to find it. I knowkensanata has made some experiments with a mush, but I haven't playedwith it (yet))
The idea is to provide two pages: one that accepts input via theresponse code 10 and appends to a file, the second is a literal `tail-f'. Simple, but it works, and it's immediate. As soon as someonesends something, all the clients reading from `tail -f' gets themessage.
(the various `tail -f' gets eventually killed by a SIGPIPE when theclient closes the connection and the server closes the script stdout.It could take a while due to the buffering, but can be worked out. Idon't know if servers are expected to kill the spawned scripts -- Idon't recall anything from the RFC -- but I'm probably wrong. gmidanyway doesn't kill the scripts, it let UNIX do its things with signals.Feature or bug? dunno.)
It doesn't require a client certificates, but uses the subject of it ifprovided. There's a check that can be de-commented to enforce the usageof client certificates.
I'm hosting a demo at
gemini://gemini.omarpolo.com/cgi/lets-chat
but I don't promise to keep it online. It's a quick-n-dirty script(less than 50 lines of -hopefully- portable sh), probably filled withbugs, wrote only to be a demonstration. I don't want to moderate itif/when people write things. It's really easy to host it locally, fore.g. using gmid (disclaimer: I'm the author)
$ gmid -x '*' .
from the same directory where you saved the script.
It seems to work with Telescope, Tinmop and Lagrange. Kristall andAmfora don't seem to support streaming, or maybe I have an old version.Elpher doesn't stream by design.
I hope this inspires someone to build amazing things with the streamingcapability of text/gemini. There are a lot of possibilities, forinstance capsules like station could stream the feed, or thenotification page; it could be better than clients continouslyrefreshing the page. Think of it like some sort of "websockets" but forhumans ;)
Gemini clients could "ring" or use some other kind of mechanism toinform the user that more content is available in a page (fore.g. Telescope adds a `!' before the tab title.)
Cheers,
Omar Polo
P.S.: this is also a partial reply to the talkat spec. I love seeingwhat creative things folks are building, and I really hope the best formbays and their idea (if I got the paternity correctly :P), but I alsolike the idea of doing these sort of things over gemini. On one hand Idon't want to push gemini over its boundaries, on the other I love doingthat :)
-------------- next part --------------A non-text attachment was scrubbed...Name: lets-chatType: application/octet-streamSize: 919 bytesDesc: not availableURL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20211004/c3f9575e/attachment-0001.obj>