replace window.WebSocket with window['WebSocket'] to avoid closure compiler issues