Safari /websocket issue

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

osc23
Posts: 17
Joined: 04 May 2007, 12:16
Location: London

Safari /websocket issue

Postby osc23 » 15 Apr 2013, 12:32

Hi guys,

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
osc23
Posts: 17
Joined: 04 May 2007, 12:16
Location: London

Re: Safari /websocket issue

Postby osc23 » 15 Apr 2013, 12:34

I should probably add that it's Safari 5.1.7 on Win 7.

Thanks
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Safari /websocket issue

Postby Bax » 16 Apr 2013, 07:59

I'm sorry but our API support Safari starting from version 6. Also take into account that Apple dropped the Safari development for Windows.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: Baidu [Spider] and 8 guests