Playing with Web Sockets
Last update on .
Been playing around a bit with web-sockets under Twisted. This time I didn't go with autobahn, as the last time I played with it I just wound up stuck on lots of stuff I didn't need. What I decided to play with is a Web Socket based server-controlled messaging daemon. It's *not* going to run your bit enterprise, it's just me playing around.
* you have a django web site
* you want to have any process on the server be able to send messages to connected sessions on any number of channels
* you want the server-side api to be dirt-simple-dumb (as in, you could include it in a bash script)
* you may want to allow a remote client to send messages to a channel as well
* there is no configuration happening on-the-wire, all control is handled by the server
* the server controls which sessions can read/write to each channel
* the server also controls which sessions can be connected
I went with txWS as the web socket implementation, mostly because it was simple to comprehend the source code. The use of the web socket isn't really all that relevant to the application, it's just how messages get to/from it. The low-level server-side sending is done with inotify watches on a directory structure (stored in a RAM disk). Server processes can write files directly or use a command-line to send them.
Anyway, the sketch is up on github https://github.com/mcfletch/ssws
Pingbacks are closed.
Comments are closed.