Skip to main content
Participant
May 4, 2009
Question

security error in flex,sockets

  • May 4, 2009
  • 1 reply
  • 1651 views

Hi,

I have a chat application in flex  using sockets.

It works fine on Flash player 9, but while uisng flash player 10 , prompts the following  error

Error: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]

whats wrong?? iam  keep searching througth the web for a solution…  …Im using .Net framework 2.0 for socket server
and flex 2

This topic has been closed for replies.

1 reply

TaylorBastien
Participant
November 10, 2009

Hi George,

I'm pretty sure I know the cause of your security sandbox problem.

In the move from Flash Player 9 to 10, Adobe increased the security constraints on sockets. As you might already know, when you use HTTP to connect to a server other than the one from which your SWF was downloaded, the Flash Player requires that a Cross-Domain Policy file be served up from the root of the target server. Prior to FP10, this constraint also existed for sockets as well, but since FP10 the requirement is more stringent: if you are using sockets to connect to an "un-trusted" server, then you will still need a Cross-Domain Policy file, however that policy file must also be served up through sockets.

In other words, you will need to set up and run a socket server on the server you are connecting to, in order to serve up the appropriate XML document through port 843 (by default). This socket server can be implemented in any number of ways, but I use a Java socket server that Thomas over at LessRain has posted on their blog. You can find it here: http://www.blog.lessrain.com/as3-java-socket-connections-to-ports-below-1024/

Good luck,

Taylor

4Point Solutions Ltd.

http://blogs.4point.com/taylor.bastien/