Did more work on websocket integration, but not finished yet.