Page 1 of 1
remove bluebox from url
Posted: 21 Aug 2023, 07:04
by rickash
i use this: var sfs = new SFS2X.SmartFox({UseBlueBox: false});
but I can't remove the 'bluebox' from the connection url to my websocket
Re: remove bluebox from url
Posted: 21 Aug 2023, 08:42
by Bax
First of all, that "UseBlueBox" parameter doesn't exist in the HTML/JS API, so you can delete it.
Then, why are you trying to remove "bluebox" from the connection string? The connection string is internal to the API, and it can't be modified.
Re: remove bluebox from url
Posted: 21 Aug 2023, 19:29
by rickash
The problem is that I want to connect to
wss://sfox.xxx.com/websocket BUT when I connect the way I said earlier, the url is:
wss://sfox.xxx.com/BlueBox/websocket
Re: remove bluebox from url
Posted: 22 Aug 2023, 07:30
by Bax
Why do you want to connect to
wss://sfox.xxx.com/websocket?
The connection will fail, because SmartFoxServer won't respond at that address.
Re: remove bluebox from url
Posted: 22 Aug 2023, 08:08
by Lapo
In order to connect to SFS2X via Javascript you just need to invoke the
SmartFox.connect() method.
Please take a look at our "Connector" example in the documentation for more details:
http://docs2x.smartfoxserver.com/ExamplesJS/connectorCheers
Re: remove bluebox from url
Posted: 22 Aug 2023, 16:22
by rickash
wss://sfox.xxx.com/websocket It's just an example, what I mean is that the server I want to connect to is not mine. and the url doesn't have that bluebox in it.
Re: remove bluebox from url
Posted: 23 Aug 2023, 07:46
by Bax
You should follow this tutorial about the connection phase:
http://docs2x.smartfoxserver.com/DevelopmentBasics/connection-phaseYou just have to create a configuration object containing the "host" property: this is where you have to enter the IP address or domain name of the server you want to connect to (just "sfox.xxx.com", as per your example). Then pass the configuration object to the SmartFox class constructor (in JavaScript).
Hope this helps.