我不知所措。我无法弄清楚为什么 Flash 无法正确加载我的策略文件。我正在从闪存调试器对此进行测试。
I've also tried from http://127.0.0.1:80/game (it sends a request to http://127.0.0.1:3014/socket.io/1/).
Security.loadPolicyFile('xmlsocket://127.0.0.1:843'); var r:URLRequest = new URLRequest(); r.url = httpProtocal+"://" + domain + "/socket.io/1/?time=" + new Date().getTime(); r.method = URLRequestMethod.POST; var ul:URLLoader = new URLLoader(r); ul.addEventListener(Event.COMPLETE, onDiscover); ul.addEventListener(HTTPStatusEvent.HTTP_STATUS, onDiscoverError); ul.addEventListener(IOErrorEvent.IO_ERROR , onDiscoverError);
错误:
> webSocketLog: policy file: xmlsocket://127.0.0.1:843 Error #2044:
> Unhandled securityError:. text=Error #2048: Security sandbox
> violation: file:///ude/game/bin-release/Game.swf cannot load data from
> http://127.0.0.1:3014/socket.io/1/?time=1359025067289. at
> com.pnwrain.flashsocket::FlashSocket()
然而,这有效:
> echo -ne '<policy-file-request/>