i don't see that you posted the actual error.
the convention is: "ws" is the websocket version of http. "wss" is the secured version. are you secure or not? i still think chrome freaks if you go from https to ws. (grok3.com is https. i think chrome balks if you try to "upgrade" to "ws".)
anyway, you posted js code. show the console error. also, window.location.replace() doesn't appear in the sub...
plus that window.location.replace() call is missing a scheme. there could be an issue there. if it inherits the caller's scheme, we could be talking about the same problem. if you're ssl, everything has to be ssl. you have to make sure all the code modules are on board. using "ws" to refer to a secure websockets
connection doesn't help.