This needs to be `window['WebSocket']` for closure compiler to work.