better cookbook recipe for WebSockets