Page 1 of 1

BlueBox is not work for js client?

Posted: 18 Jan 2018, 09:39
by zynbasil
js client:
When I change wifi , connect will be lost.

c++ client:
Use bluebox ,change wifi, everything is fine

Help~

*********
http://docs2x.smartfoxserver.com/GettingStarted/bluebox
http://docs2x.smartfoxserver.com/api-do ... rtFox.html

Example
This example instantiates the SmartFox class passing a configuration object.

function init()
{
// Create configuration object
var config = {};
config.host = "127.0.0.1";
config.port = 8080;
config.useSSL = false;
config.zone = "BasicExamples";
config.debug = false;

// Create SmartFox client instance
sfs = new SFS2X.SmartFox(config);
}

Re: BlueBox is not work for js client?

Posted: 18 Jan 2018, 15:23
by Lapo
Hi,
no the JS API does not support the BlueBox. However keep in mind that websockets are part of the HTTP protocol so if you run Jetty on a HTTP friendly port (such as 80 or 443) you'll never need the BlueBox.

Hope it helps

Re: BlueBox is not work for js client?

Posted: 19 Jan 2018, 09:57
by zynbasil
I change server port to 80 & 443

It also disconnect when change wifi~

Any suggestion?

Re: BlueBox is not work for js client?

Posted: 19 Jan 2018, 10:12
by Lapo
The problem with WiFi is to be expected, and has nothing to do with the API.
It's a deeper issue with how networks works.Please read here:

http://smartfoxserver.com/blog/what-rea ... tworkwifi/
http://smartfoxserver.com/blog/handling ... e-devices/

Cheers

Re: BlueBox is not work for js client?

Posted: 19 Jan 2018, 14:11
by zynbasil
But c++ client use bluebox, change WIFI , will not disconnect.
Why? Because bluebox?

Re: BlueBox is not work for js client?

Posted: 19 Jan 2018, 15:19
by Lapo
Yes,
the BlueBox uses HTTP which isn't dependent on a persistent connection. Every BBox call uses a separate HTTP connection, so it doesn't mind if you switch from WiFi to 3G/4G etc...

cheers

Re: BlueBox is not work for js client?

Posted: 19 Jan 2018, 15:55
by zynbasil
Thanks :D