remove bluebox from url

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

Post Reply
rickash
Posts: 4
Joined: 21 Aug 2023, 07:01

remove bluebox from url

Post 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
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: remove bluebox from url

Post 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.
Paolo Bax
The SmartFoxServer Team
rickash
Posts: 4
Joined: 21 Aug 2023, 07:01

Re: remove bluebox from url

Post 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
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: remove bluebox from url

Post 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.
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: remove bluebox from url

Post 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/connector

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
rickash
Posts: 4
Joined: 21 Aug 2023, 07:01

Re: remove bluebox from url

Post 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.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: remove bluebox from url

Post by Bax »

You should follow this tutorial about the connection phase:
http://docs2x.smartfoxserver.com/DevelopmentBasics/connection-phase
You 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.
Paolo Bax
The SmartFoxServer Team
Post Reply