Fix WebSocket construction in the browser.