Move websocket stuff into a pipe module