Hello,
I 've tried a lot, but I really can't connect to the smartfoxserver 2X with html5 websocket. ( working fine with Flash )
I 've tried with a telnet myip 8888 with success. But not at all with the differents examples in JS/HTML5.
Always the same message : "Connection failed: Is the server running at all? "
Same thing under Chrome /Firefox.
Any Idea?
Thank you so much
HTML5 / JS APi fail to connect
-
- Posts: 5
- Joined: 14 Jul 2014, 16:29
HTML5 / JS APi fail to connect
Last edited by bribarthelemy on 14 Jul 2014, 20:45, edited 1 time in total.
Re: HTML5 / JS APi fail to connect
Hi there,
Just to make sure, have you enabled the WebSockets protocol on the Server Configurator Module of the Admin Tool?
The html5 examples are hard coded to connect to 127.0.0.1. Have you updated the code so it connects to your server's IP?
Cheers
Just to make sure, have you enabled the WebSockets protocol on the Server Configurator Module of the Admin Tool?
The html5 examples are hard coded to connect to 127.0.0.1. Have you updated the code so it connects to your server's IP?
Cheers
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 5
- Joined: 14 Jul 2014, 16:29
Re: HTML5 / JS APi fail to connect
Thanks for reply!
Yes , I have enabled the websocket
And I have changed the config.xml as you can see in the log console here:
any Idea?
Yes , I have enabled the websocket
And I have changed the config.xml as you can see in the log console here:
any Idea?
Re: HTML5 / JS APi fail to connect
The config.xml? The AdvancedChat example has the IP hard coded on its main.js file...
Can you also check on the logs if is there any error occuring at the server side?
Thanks
Can you also check on the logs if is there any error occuring at the server side?
Thanks
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 5
- Joined: 14 Jul 2014, 16:29
Re: HTML5 / JS APi fail to connect
Thanks a lot for your help.
However ; I 've changed in main.js ( you can see it on the picture, the ip has been changed )
ANd here is my log :
another idea?
However ; I 've changed in main.js ( you can see it on the picture, the ip has been changed )
ANd here is my log :
14 Jul 2014 | 21:47:40,413 | INFO | New I/O worker #2 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 2, Type: WEBSOCKET, Logged: No, IP: 109.130.x.x } on Server port: 8888 <---> 53789
14 Jul 2014 | 21:47:40,453 | INFO | New I/O worker #2 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 2, Type: WEBSOCKET, Logged: No, IP: 109.130.x.x:53789 }
another idea?
Re: HTML5 / JS APi fail to connect
Hmm...
On the server-side logs, right before the "SFS2X Ready" ASCII art, where it says "Listening Sockets", does it show the correct 5.XXXX ip with the 8888 port?
Can you check if you didn't made the same mistake as the following post?
viewtopic.php?f=33&t=16833
And please make sure you have no firewall blocking traffic on that port nor and review your router's port forwarding configuration (in case you're behind one)
Cheers
On the server-side logs, right before the "SFS2X Ready" ASCII art, where it says "Listening Sockets", does it show the correct 5.XXXX ip with the 8888 port?
Can you check if you didn't made the same mistake as the following post?
viewtopic.php?f=33&t=16833
And please make sure you have no firewall blocking traffic on that port nor and review your router's port forwarding configuration (in case you're behind one)
Cheers
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 5
- Joined: 14 Jul 2014, 16:29
Re: HTML5 / JS APi fail to connect
Hello,
Once again, thank you for reply.
As you see on the console, the ip is the internet IP
May I ask you something if you have time? COUld you download last release of 2X and html5 exemple ?
And try if all these last one work fine for you...
If you don't have tile. Of course, do not worry
In the console log, I have this :
Thank you
Once again, thank you for reply.
As you see on the console, the ip is the internet IP
May I ask you something if you have time? COUld you download last release of 2X and html5 exemple ?
And try if all these last one work fine for you...
If you don't have tile. Of course, do not worry
In the console log, I have this :
Code: Select all
WebSocket connection to 'ws://5.39.xxx.xxx:8888/' failed: Error during WebSocket handshake: Unexpected response code: 200
Thank you
Re: HTML5 / JS APi fail to connect
Hi there,
Yesterday I've faced that same error when working on my end.
That error occurs when using the previous API with the most recent version of SFS2X.
You can fix it by downloading the most recent version of the HTML5 Client API from:
http://www.smartfoxserver.com/download/sfs2x#p=client
Cheers
Yesterday I've faced that same error when working on my end.
That error occurs when using the previous API with the most recent version of SFS2X.
You can fix it by downloading the most recent version of the HTML5 Client API from:
http://www.smartfoxserver.com/download/sfs2x#p=client
Cheers
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
- Posts: 5
- Joined: 14 Jul 2014, 16:29
Re: HTML5 / JS APi fail to connect
It works soo much better!!!
Thank you
Thank you
Re: HTML5 / JS APi fail to connect
Just to recap. Does the problem go away by using the latest API?
If yes, then it is expected. SFS2X 2.9 requires the usage of the latest HTML5 API.
Cheers
If yes, then it is expected. SFS2X 2.9 requires the usage of the latest HTML5 API.
Cheers
Re: HTML5 / JS APi fail to connect
Lapo wrote:Just to recap. Does the problem go away by using the latest API?
If yes, then it is expected. SFS2X 2.9 requires the usage of the latest HTML5 API.
Cheers
Ohayo Lapo,
Yeah, the problem is fixed by using the latest API.
The only problem is that the current HTML5 Examples package ships with the previous API version and, therefore, the examples don't work on the latest version of SFS2X by default.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: HTML5 / JS APi fail to connect
Yes, we're going to update the HTML5 example pack very shortly, with the latest API included.
Sorry for the inconvenience.
Sorry for the inconvenience.
Re: HTML5 / JS APi fail to connect
The updated examples pack is now available on the download page: http://www.smartfoxserver.com/download/sfs2x#p=examples
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Return to “SFS2X HTML5 / JavaScript API”
Who is online
Users browsing this forum: No registered users and 14 guests