I've had some fun trying to connect to the server with Safari this morning. It insists on using either the wss: prefix (which breaks other browsers) or the address having /websocket on the end...
"Error during WebSocket handshake: location mismatch: ws://xxx.xxx.xxx.xx:8888/ != ws://xxx.xxx.xxx.xx:8888/websocket"
I've hardcoded the string onto the end of the address in SFS2X.SocketEngine.prototype.connect and it works in FF, Chrome and Safari...
Code: Select all
SFS2X.SocketEngine.prototype.connect = function (a, b)
{
this.isConnected ? this._log.error("Connection is already active") : this.isConnecting ? this._log.error("A connection attempt is already in progress") : (this.isConnecting = !0, this._socket = new WebSocket("ws://" + a + ":" + b + "/websocket"), this._socket._scope = this, this._socket.onopen = this._onSocketConnect, this._socket.onclose = this._onSocketDisconnect, this._socket.onmessage = this._onSocketData, this._socket.onerror = this._onSocketError)
};
Can we have this added to the next release so I don't have to remember to do it? If this causes other issues, then could we pass a flag asking for it to be added but defaults to not?
Thanks
osc23