WebsSockets with kirby?

I tried implementing something using websockets myself as well. Its a bit tricky, but you can manage your own script by calling it in a separate process.

See this question for the code-snippet. I asked there if there is a way to do post-request / post-route processing, but unfortunately I think the external process is the only way to make things work without editing the Kirby-installation, or without .htaccess magic, as far as I can figure out.

Keep in mind though that every other aspect of the websocket stuff (or Server-sent-events for your second suggestion) you need to implement yourself (either by third-party implementation, or a custom one).