Using location.host instead of location.hostname and relying on the webserver to route the /ws path.