When using webpack, the "Socket = ws.Client || ws.client || ws;" part get's executed and the socket don't work anymore in a browser.