gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 488 forks source link

Also include a cross-domain serve-able SWF. #32

Closed TooTallNate closed 14 years ago

TooTallNate commented 14 years ago

A buddy of mine testing one of my projects sent me this email:

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8

the error:

An ActionScript error has occurred:
SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller http://engine.simplegameframework.com/lib/WebSocketMain.swf cannot access http://www.simplegameframework.com/.
    at flash.external::ExternalInterface$/_initJS()
    at flash.external::ExternalInterface$/addCallback()
    at bridge::FABridge/initializeCallbacks()
    at bridge::FABridge()
    at WebSocketMain()

I've been getting lots of similar errors to this on other sites recently.. Don't know what's up. 

I think the solution is to include Security.allowDomain("*") somewhere in the Flash code, and that will allow it to be served over distinct domains. You might want to include this hotlink-able version inside of a ZIP in the repo, otherwise there might be problems of people hotlinking to the SWF where they shouldn't be. Including it in a ZIP forces people to extract it if they really wanted to use it.

SoundManager 2 employs a similar technique, if you needed to take notes from it.

rauchg commented 14 years ago

http://github.com/gimite/web-socket-js/issues/#issue/31

gimite commented 14 years ago

As guille mentioned, we just discussed it in another thread. And your idea to include it as ZIP file looks good idea. I'll do that soon. Thanks for the suggestion.

gimite commented 14 years ago

Added ZIP file as TooTallNate suggested with: http://github.com/gimite/web-socket-js/commit/9e766377188d461f2046d951cc12645d457eb8e8 and added instruction to README file.

TooTallNate commented 14 years ago

Closing...