Several of our systems require a simple websocket server. This is one.
There are many like it but this is mine.
Web Sockets are basically a distributed whiteboard. Think of them
as a realtime command-and-control IRC channel that you can access from
But since this is the Stupidest Timeline, the received wisdom for how
you spin up a WebSocket server involves installing libraries that will pull
in 100k lines of code from whatever the singing-est dancing-est toolkit
du jour is, and do you have time to audit that crap? I don't. All this just
to let you burp out literally 20 lines of on-the-wire protocol.
Net::WebSocket::Server, which gets my vote. It's tiny and
very low level. The documentation was confusing and functional examples
nonexistent. However, I eventually figured out how to make it go, and so
now you can too:
It runs separate rooms for each "path" part of the wss: URL.
You have access to cookies, so you can plug in your authentication
mechanism that way.
It lets you connect, post a notification, disconnect; or sit there and
wait for a response for a little while.