JavaScript Canvas integrated with a WebSocket