HTML Client API can't connect to server - hang at "Sending request 'HandshakeRequest' to server"
Posted: 28 Apr 2017, 08:20
Hi. as title said, I'm using JS Client to connect to Smartfoxserver 2X, but it can't success.
I have tried to connect to server by pure Websocket API then successful, with SFS2X client, I get only the info below by all time and nothing else
This is my code and info
Server version: Smartfoxserver 2X v2.13
All server configurations is default.
Client API:
- Version: 1.7.0
- Release date: Apr 26th, 2017
thank for help!
----Update----
I have new problem with product server. now I'm need to connect to a server version 2.8.5. And option "Enable WS/WSS" is on but my problem appear again
I tried to use Client API 1.7.1 and it can connect to server but there is no SFSObject in API, the document for SFSObject 's just work with Client API 1.7.0.
What can I do in this case?
I have tried to connect to server by pure Websocket API then successful, with SFS2X client, I get only the info below by all time and nothing else
Code: Select all
[ SFS2X | INFO ] Attempting connection to server
[ SFS2X | INFO ] Sending request 'HandshakeRequest' to server
This is my code and info
Code: Select all
app.sfs = new SFS2X.SmartFox();
app.sfs.debug = true;
app.sfs.addEventListener(SFS2X.SFSEvent.CONNECTION, onConnection, this);
app.sfs.addEventListener(SFS2X.SFSEvent.EXTENSION_RESPONSE, onExtensionResponse, this);
app.sfs.connect("localhost", 8080, false);
function onConnection(event) {
if (event.success) {
console.log("Connected to SmartFoxServer 2X!");
} else {
alert("Failed!");
}
}
function onExtensionResponse(event) {
console.log(event);
}
Server version: Smartfoxserver 2X v2.13
All server configurations is default.
Client API:
- Version: 1.7.0
- Release date: Apr 26th, 2017
thank for help!
----Update----
I have new problem with product server. now I'm need to connect to a server version 2.8.5. And option "Enable WS/WSS" is on but my problem appear again
I tried to use Client API 1.7.1 and it can connect to server but there is no SFSObject in API, the document for SFSObject 's just work with Client API 1.7.0.
What can I do in this case?