Help required setting up BlueBox

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Help required setting up BlueBox

Postby aaulia » 18 Aug 2011, 11:59

Hi guys, I have a problem with setting up my client app to use BlueBox. Of course I have read and tried several ways before posting here.

This is how I set it up:
1. In my server the jetty server is up and running in 8080, I can access the page in <SERVER_IP>:8080 which open up a web page with link to various place, including AdminTools.
2. I created the client config file named "dummy-config.xml" which contain :

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<SmartFoxConfig>
   <ip>xx.xx.xx.xx</ip>
   <port>9933</port>
   <zone>xxxxxxx</zone>
   
   <debug>true</debug>
   
   <httpPort>8080</httpPort>
   <useBlueBox>true</useBlueBox>
   <blueBoxPollingRate>500</blueBoxPollingRate>
</SmartFoxConfig>

3. I load it from my code like so:

Code: Select all

      private function init():void
      {
         sfs = new SmartFox(testing);
         
         // Add event listeners
         sfs.addEventListener(SFSEvent.CONFIG_LOAD_SUCCESS, onConfigLoadSuccess, false, 0, true);
         sfs.addEventListener(SFSEvent.CONFIG_LOAD_FAILURE, onConfigLoadFailure, false, 0, true);
         sfs.addEventListener(SFSEvent.CONNECTION, onConnection, false, 0, true);
         sfs.addEventListener(SFSEvent.CONNECTION_LOST, onConnectionLost, false, 0, true);
         sfs.addEventListener(SFSEvent.LOGIN_ERROR, onLoginError, false, 0, true);
         sfs.addEventListener(SFSEvent.LOGIN, onLogin, false, 0, true);
         sfs.addEventListener(SFSEvent.EXTENSION_RESPONSE, onExtensionResponse, false, 0, true);
         sfs.addEventListener(SFSEvent.CONNECTION_ATTEMPT_HTTP, onConnectionAttempHTTP, false, 0, true);
      }
      
      private function onConnectionAttempHTTP(e:SFSEvent):void
      {
         D.info("Attempting connection through HTTP...");
      }
      
      private function onConfigLoadFailure(evt:SFSEvent):void
      {
         D.info( "Unable to load client configuration file" );
      }

      private function onConfigLoadSuccess(e:SFSEvent):void
      {
         sfs.connect(BuildSettings.APP_SERVER_URI, 9933);
      }
      
      public function login():void
      {
         D.info("Loading logging configuration");
         sfs.loadConfig("dummy-config.xml", false);
      }

As you can see, In normal condition I connect through IP from the code config (BuildSettings.APP_SERVER_URI). I assume after I set this all up, if the connection through socket (9933) failed, it will automatically switch to BlueBox (8080). Apparently it doesn't :(

I test it by blocking my 9933 port for outgoing connection (through Windows Firewall), which successfully block my app in connecting through the normal socket connection. But the problem is the BlueBox is not used, so even if I enable the BlueBox like I said before the app still can't connect to the server.

Is there something wrong in my steps, or maybe you guys could suggest me things to check ?
Thanks a lot.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Aug 2011, 15:41

What error do you get in the client? Check from the Flash IDE or Flex debug

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 18 Aug 2011, 16:15

Hi Lapo, thanks for the reply, I'll check tomorrow I guess, since I don't really pay attention to the traces (my bad).

But at one time I tried just directly setting the port to 8080 in the connect() function (because I read somewhere in the forum that the OP cannot connect using standard 9933, but he can connect with 8080). The client throw an error about bad header length 72 byte or something.

But to be sure, I'll check and come back tomorrow.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Aug 2011, 18:52

Don't do that. Connect always start with sockets, if you pass 8080 you will simply force the client to speak with the BBox while it is expecting the binary socket.
The config sees right so you are on the right track.
Let us know the error
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 19 Aug 2011, 03:36

Hi guys, I'm back, so here is the trace result just right before the failed connection attempt

Code: Select all

[-] Connecting to 70.32.84.95...
Error: Request for resource at xmlsocket://xx.xx.xx.xx:9933 by requestor from http://xxxx.xxxxx.com/xxx.swf?xxx.... has failed because the server cannot be reached.
*** Security Sandbox Violation ***
Connection to xx.xx.xx.xx:9933 halted - not permitted from http://xxxx.xxxxx.com/xxx.swf?xxx....
## SecurityError: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://xxxx.xxxxx.com/xxx.swf?xxx.... cannot load data from xx.xx.xx.xx:9933."]
[-] failed connect to SFSX2 Server!


If I lift the firewall block it works just like usual, although I get some warning about

Code: Select all

Warning: Ignoring <site-control> tag in policy file from xmlsocket://xx.xx.xx.xx:9933.


but everything went OK.
Any thought ?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Aug 2011, 07:24

This is super confusing. Are you really using SmartFoxServer 2X?
The error shows an attempt to use XMLSocket on port 9933. That's not possible if you use 2X.

Please specify which version of the server are you using, the latest SFS2X is RC3, version 2.0.0-RC3
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 19 Aug 2011, 07:41

Hi Lapo, sorry for the confussion, but I'm pretty sure I'm running 2X. Here is my fresh startup logs (smartfox, boot and bluebox). Hope this helps

Smartfox.log

Code: Select all

19 Aug 2011 15:40:43,267 INFO  [main] smartfoxserver.v2.SmartFoxServer     - Boot sequence starts...
19 Aug 2011 15:40:43,295 INFO  [main] smartfoxserver.v2.SmartFoxServer     -
 _____ _____ _____    ___ __ __    _____ _____ _____ _____
|   __|   __|   __|  |_  |  |  |  | __  |     |     |_   _|
|__   |   __|__   |  |  _|-   -|  | __ -|  |  |  |  | | | 
|_____|__|  |_____|  |___|__|__|  |_____|_____|_____| |_|

19 Aug 2011 15:40:44,103 INFO  [main] smartfoxserver.v2.SmartFoxServer     - License code not found, starting Community Edition license
19 Aug 2011 15:40:44,103 INFO  [main] v2.core.SFSEventManager     - AnonymousService-1 initalized
19 Aug 2011 15:40:44,125 INFO  [main] vfs.impl.DefaultFileReplicator     - Using "/tmp/vfs_cache" as temporary files store.
19 Aug 2011 15:40:44,360 INFO  [main] smartfoxserver.v2.SmartFoxServer     - License loaded:

===================================
LICENSE DETAILS
-----------------------------------
Type            : Community Edition
Max users       : 100
===================================

19 Aug 2011 15:40:44,362 INFO  [main] entities.managers.SFSBannedUserStorage     - BanUserStorage initialized
19 Aug 2011 15:40:44,417 INFO  [main] entities.managers.SFSBannedUserManager     - BanUser data loaded: 0 records.
19 Aug 2011 15:40:44,467 INFO  [main] v2.config.SFSConfigurator     - Loading: zones/FreesiaCity.zone.xml
19 Aug 2011 15:40:44,511 INFO  [main] entities.managers.SFSZoneManager     -

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: FreesiaCity
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

19 Aug 2011 15:40:46,136 INFO  [main] Extensions     - {FreesiaCityExtension}: FreesiaCityExtension Extension started. 
19 Aug 2011 15:40:46,159 INFO  [main] v2.api.SFSApi     - Room created: [ Room: AdminRoom, Id: 0, Group: default, isGame: false ]
19 Aug 2011 15:40:46,176 INFO  [main] v2.core.AdminToolService     - AdminTool Service started
19 Aug 2011 15:40:47,722 INFO  [main] v2.http.SFSHttpServer     - Http Server started.
19 Aug 2011 15:40:47,768 INFO  [main] smartfoxserver.v2.SmartFoxServer     - Listening Sockets: { xx.xx.xx.xx:9933, (Tcp) }
19 Aug 2011 15:40:47,771 INFO  [main] smartfoxserver.v2.SmartFoxServer     - 
 _____ _____ _____    ___ __ __
|   __|   __|   __|  |_  |  |  |
|__   |   __|__   |  |  _|-   -|
|_____|__|  |_____|  |___|__|__|                                         
 _____ _____ _____ ____  __ __
| __  |   __|  _  |    \|  |  |
|    -|   __|     |  |  |_   _|
|__|__|_____|__|__|____/  |_| 
[ 2.0.0-RC3 ]

19 Aug 2011 15:40:47,774 INFO  [main] smartfoxserver.v2.SmartFoxServer     - SmartFoxServer 2X (2.0.0-RC3) READY!


Boot.log

Code: Select all

19 Aug 2011 15:40:47,722 INFO  [main] bootLogger     - SmartFoxServer 2X
19 Aug 2011 15:40:47,733 INFO  [main] bootLogger     - BitSwarmEngine version: 3.4.3 { main }
19 Aug 2011 15:40:47,734 INFO  [main] bootLogger     - System Info:
   Processor(s): 4
   VM Max. memory: 477MB
   os.name: Linux
   os.arch: i386
   os.version: 2.6.9-023stab053.2-enterprise
   java.version: 1.6.0_21
   java.vendor: Sun Microsystems Inc.
   java.vendor.url: http://java.sun.com/
   java.vm.specification.version: 1.0
   java.vm.version: 17.0-b16
   java.vm.vendor: Sun Microsystems Inc.
   java.vm.name: Java HotSpot(TM) Server VM
   java.io.tmpdir: /tmp
   Default charset: UTF-8

19 Aug 2011 15:40:47,735 INFO  [main] bootLogger     - Network Info:
   Card: venet0
       ->xx.xx.xx.xx
       ->127.0.0.1
   Card: lo
       ->127.0.0.1

19 Aug 2011 15:40:47,741 INFO  [main] bootLogger     - Session manager ready: com.smartfoxserver.bitswarm.sessions.DefaultSessionManager@11dca40
19 Aug 2011 15:40:47,747 INFO  [main] bootLogger     - ReaderSelector opened
19 Aug 2011 15:40:47,757 INFO  [main] bootLogger     - AcceptSelector opened
19 Aug 2011 15:40:47,760 INFO  [main] bootLogger     - Added bound tcp socket --> xx.xx.xx.xx:9933
19 Aug 2011 15:40:47,761 INFO  [main] bootLogger     - Controller started: com.smartfoxserver.v2.controllers.SystemController -- Queue: 0/20000
19 Aug 2011 15:40:47,762 INFO  [main] bootLogger     - Controller started: com.smartfoxserver.v2.controllers.ExtensionController -- Queue: 0/20000
19 Aug 2011 15:40:47,762 INFO  [main] bootLogger     - IOHandler: com.smartfoxserver.v2.protocol.SFSIoHandler@186092
19 Aug 2011 15:40:47,762 INFO  [main] bootLogger     - SocketReader started
19 Aug 2011 15:40:47,762 INFO  [main] bootLogger     - SocketAcceptor initialized
19 Aug 2011 15:40:47,763 INFO  [main] bootLogger     - Socket Writer started (pool size:1)
19 Aug 2011 15:40:47,765 INFO  [main] bootLogger     - Security Manager started
19 Aug 2011 15:40:47,767 INFO  [main] bootLogger     - [[[ ===--- Boot sequence complete ---=== ]]]
19 Aug 2011 15:40:47,768 INFO  [Scheduler1-thread-1] bootLogger     - Scheduler started: scheduler


Bluebox.log

Code: Select all

2011/08/19 15:40:47.690 - [ INFO ] [id: 10] (SessionFilter.init): BlueBox-2X Service started
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 19 Aug 2011, 12:43

aaulia wrote:If I lift the firewall block it works just like usual, although I get some warning about

Code: Select all

Warning: Ignoring <site-control> tag in policy file from xmlsocket://xx.xx.xx.xx:9933.


but everything went OK.
Any thought ?


I think you shouldn't worry about this too much since apparently It was just one time (AFAIK). And I used SFS 2X RC3, so it might came from my code somewhere.

Any though about solving this ?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 20 Aug 2011, 16:08

Sounds like a problem with the Flash crossdomain policy.
Are you testing from within Flash? Or Flex? Or do you run a standalone FlashPlayer? Or testing from a webpage?

Did you edit/change the config/crossdomain.xml ?
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 20 Aug 2011, 16:27

Hi Lapo,

I access it from a latest web flash player (both debug and release version) using Firefox and Chrome.

AFAIK I haven't edited my config/crossdomain.xml, but to be sure its the correct one, here is my config/crossdomain.xml:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <!-- This is a master-policy file. site-control can be all,none,master-only -->
   <site-control permitted-cross-domain-policies="all"/>

   <!-- Instead of setting to-ports="*", administrators can use ranges and commas -->
   <!-- This will allow access to ports 123, 456, 457, and 458 -->
   <allow-access-from domain="*" to-ports="9933" />
</cross-domain-policy>


Also the error/exception message that I posted before seems pretty reasonable, I mean the client can't access port 9933. I was hoping to see error connecting to port 8080, but it never came up :-/.

If you have an example of some sort that I can test the behavior of bluebox, it would be very helpful. Or maybe there is a way to force Bluebox (and bypass accessing the socket altogether, for testing sake?).

Sorry if I'm being forceful but I really need this to be solved.

EDIT: for completeness sake, here is the crossdomain.xml in the website where the flash is hosted.

Code: Select all

<cross-domain-policy><site-control permitted-cross-domain-policies="all"/><allow-access-from domain="*" secure="false"/><allow-http-request-headers-from domain="*" headers="*" secure="false"/></cross-domain-policy>
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 20 Aug 2011, 21:28

I want to try on my side, please send me the IP address of your server and let me know if the SimpleChat Zone is active, so that I can try one of our demo apps.
You can use an email or PM
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 21 Aug 2011, 02:24

Okay I'll get back to you, I just need to recheck somethings... thanks Lapo, I appreciate it :)
User avatar
aaulia
Posts: 31
Joined: 28 May 2011, 18:50

Postby aaulia » 25 Aug 2011, 01:54

Just want to put some closure to this thread :). It turns out I'm using old version of the AS3 API 0.9.8, while the latest AS3 API for RC3 is 0.9.15. Thanks to Lapo for patiently help me test stuff :D.
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Help required setting up BlueBox

Postby Madhav » 07 Mar 2014, 06:49

Hai Lapo,

I am facing the exactly same problem with no solution. The error I get is below,

Code: Select all

Warning: Timeout on xmlsocket://xx.xxx.xxx.xx:843 (at 3 seconds) while waiting for socket policy file.  This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.

## SecurityError: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://xx.xxx.xxx.xx/vw.swf?nocache=1.1 cannot load data from xx.xxx.xxx.xx:9933."]

Warning: Timeout on xmlsocket://xx.xxx.xxx.xx:9933 (at 3 seconds) while waiting for socket policy file.  This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.

Error: SWF from http://xx.xxx.xxx.xx/vw.swf?nocache=1.1 may not connect to a socket in its own domain without a policy file.  See http://www.adobe.com/go/strict_policy_files to fix this problem.

*** Security Sandbox Violation ***
Connection to xx.xxx.xxx.xx:9933 halted - not permitted from http://xx.xxx.xxx.xx/vw.swf?nocache=1.1


And this error is random, sometimes it comes and sometimes it doesn't. Im stuck.. Please help...
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Help required setting up BlueBox

Postby Lapo » 07 Mar 2014, 09:11

It looks like your server is not reachable. It might be due to a client or server side firewall.
Please check the state of the server via the troubleshooting guide and tell us what happens:
http://docs2x.smartfoxserver.com/Gettin ... leshooting

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 124 guests