Unable to connect to Smartfox using JS/HTML5 API

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

knetworx
Posts: 15
Joined: 12 Jul 2011, 23:50

Unable to connect to Smartfox using JS/HTML5 API

Postby knetworx » 11 Feb 2014, 18:52

I currently have a game running in an AS3 client connected to a series of Smartfox servers, and have had this working for a few years. I'm now attempting to set up a simple Javascript client for a product manager to send server-wide admin messages for events in the game, or to notify users when there is a game update, etc.

I've set up the HTML5 WebSocket in the Smartfox admin panel (under Server Configurator) using the server's public IP address and port 8888. I've modified the example BuddyMessenger JS/HTML5 client to connect to our server. However, when I try to connect using the JS client, I keep getting the message "Connection failed: Is the server running at all?" (The callback is being called with only one parameter in the event, success=false, so there's no more information.) I made sure to restart the server so the changes would take effect.

I'm assuming there's something wrong with my socket configuration on the server, as I was able to set up the Android example (SimpleChat) with no issues, and send messages back and forth with the AS3 game client.

I'm not seeing any errors in the logs, and I see output showing that it's listening on the socket:
11 Feb 2014 | 18:10:37,389 | INFO | main | smartfoxserver.v2.SmartFoxServer | | Listening Sockets: { <serverPublicIP>:8888 (WebSocket) }
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unable to connect to Smartfox using JS/HTML5 API

Postby Lapo » 11 Feb 2014, 20:29

Are you sure that TCP port 8888 is not blocked by a firewall?
You can easily test by telnetting the public IP on that port. If you're not familiar with what I am talking about take a look here:
http://docs2x.smartfoxserver.com/Gettin ... leshooting

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
knetworx
Posts: 15
Joined: 12 Jul 2011, 23:50

Re: Unable to connect to Smartfox using JS/HTML5 API

Postby knetworx » 11 Feb 2014, 20:38

Yeah, telnet command failed, so I guess it's blocked by the firewall. I'll have to talk to a sys admin to see what our policy is on this, because I'm currently in the experimental phase on this.

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 23 guests