I stumbled across this little gem the other day — websocketd — which turns anything that takes standard-in and standard-out into a websocket server!