Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Cross-Domain Policy File

Community Beginner ,
Jan 12, 2013 Jan 12, 2013

I just made an IRC client for Android + iOS, and now I'm having issues porting it to the browser.  I've built flash games where the server hosts the Policy Domain File, obviously with an IRC client that's not going to happen in all instances.

I'm wondering why the browser version can run perfectly fine under CS6's debug mode, but when it's been deployed to the browser it can't seem to connect?  What settings would I have to do [if at all possible] to replicate this debug mode [in CS6] inside the browser?

Thanks!

TOPICS
ActionScript
666
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2013 Jan 13, 2013

What errors are you checking for when using your Socket? Something has to be issuing an error. Be sure to import syncronous and asyncronous errors just for safety, e.g.:

// sync

try

{

     mySocket.connect('ip',port);

}

catch (e:IOErrorEvent)

{

     MyLogFunction("Caught IOErrorEvent: " + e);

}

catch (e:SecurityErrorEvent)

{

     MyLogFunction("Caught SecurityErrorEvent: " + e);

}

catch (e:IOError)

{

     MyLogFunction("Caught IOEvent: " + e);

}

catch (e:Error)

{

     MyLogFunction("Caught Error: " + e);

}

I've found some odd times I needed those in sync even though it's an async method.

Just be certain to look at all generated errors and (MyLogFunction) give yourself a way to see those errors.

IRC servers way back always required an identd server running. You may very well successfully connect but get bumped for reasons similar to that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2013 Jan 13, 2013

I recoded the listeners for the connect to handle it like, and it still throws the Security Error Event #2048.  No other error was caught.

So you're saying CS6 when it launches the program in debug mode  [and possibly iOS and Android because it's able to connect properly] it might have an identd server running?  Would there be a way to replicate that through the browser in as3 code? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2013 Jan 14, 2013
LATEST

In the browser, are you running it via Flash Player or are you making an AIR for web app?

The browser is the strictest sandbox Flash can run in. The infamous #2048 is a generic security violation. You're doing something your current sandbox doesn't allow. The most obvious thing to verify is on the SWF output settings make sure your sandbox is set to access network files, not access local files. Otherwise you'll get that error.

Outside that it's going to be looking for a socket policy file. I won't even get into creating these because your endpoint is an IRC server. Unless you're running your own IRC server you're not going to get some IRC server host to install a socket policy file for you so that point is moot. Without the socket policy file you're in some tough territory that will require some advanced debugging.

My suggestion would be to get Fiddler so you can actually see the request and response packets being sent to and from Flash inside your browser. You will definitely see Flash make a request and the response will give you clues on what's happening just before you receive the #2048 security error. You may see it request the policy file and then the server returns nothing or an invalid response and then Flash gives you the error. If that happens you may be out of luck.

Here's fiddler (I'd update your .NET to the latest and use V4 instead of V2):

http://www.fiddler2.com/fiddler2/version.asp

Here's another Adobe post of someone having a #2048 error while using fiddler to diagnose it:

http://forums.adobe.com/message/4668901#4668901

The fiddler site has some documentation. It's a pretty great tool for analyzing packet traffic (using the "select process" target will limit the packets to a browser you select (or any other app)). You may need to enable decrypting HTTPS traffic if you're using a SecureSocket. There's all instructions there on helping you diagnose and watch the inner workings of all requests/responses to track down the issue quickly.

Lastly I would uninstall Fiddler after you're done with it and reinstall it later when you need it. Especially if you enable HTTPS decryption. It must install some fake certificates to allow itself to intercept traffic. You'll just clutter up your certificates with junk certs if you keep fiddler installed. It's a very quick install/uninstall and the software itself is very widely used and regarded. It's not a trust thing, it's a cleanliness thing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines