Flash Socket Cross Domain Security Issue

▼魔方 西西 提交于 2019-12-31 05:27:05

问题


I made my flash FTP transfer using socket , but when putting it in HTML file i am getting cross domain error, i have tried with various possibilities but failed. Please help me if anybody know how to how to do socket policy in flash as3.

My file is placed at root of my ipaddress and I have tried with following options 1) Security.loadPolicyFile('xmlsocket://ipaddress:80/crossdomain.xml'); with 80 port

2) Security.loadPolicyFile('xmlsocket://ipaddress/crossdomain.xml'); without mentioning any point

3) Security.loadPolicyFile('xmlsocket://ipaddress:diffport/crossdomain.xml'); trying with different port


回答1:


To validate a server policty with flash for a socket server, remove the file name: Security.loadPolicyFile('xmlsocket://ipaddress:port');

It assume that your server listen to the given port and will return the security policy. However the port you given (80) is the http port, so it may not be valid (used for the http requests)




回答2:


Socket policy files are served differently than crossdomain policy files for HTTP requests. You need a socket policy server, not just a socket policy file placed on an HTTP server. See http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html



来源:https://stackoverflow.com/questions/7412203/flash-socket-cross-domain-security-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!