Flash Socket跨域安全问题
我使用套接字进行了 Flash FTP 传输,但是当将其放入 HTML 文件时,我遇到了跨域错误,我尝试了各种可能性但失败了。如果有人知道如何在 flash as3 中执行套接字策略,请帮助我。
我的文件放置在我的 IP 地址的根目录下,我尝试过以下选项 1) Security.loadPolicyFile('xmlsocket://ipaddress:80/crossdomain.xml')
; 使用 80 端口
2) Security.loadPolicyFile('xmlsocket://ipaddress/crossdomain.xml');
不提及任何点
3) Security.loadPolicyFile('xmlsocket://ipaddress:diffport/crossdomain.xml');
尝试使用不同的端口
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使用闪存验证套接字服务器的服务器策略,请删除文件名:
Security.loadPolicyFile('xmlsocket://ipaddress:端口');
它假设您的服务器侦听给定端口并将返回安全策略。
但是您给出的端口 (80) 是 http 端口,因此它可能无效(用于 http 请求)
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)
套接字策略文件的服务方式与 HTTP 请求的跨域策略文件的服务方式不同。您需要一个套接字策略服务器,而不仅仅是放置在 HTTP 服务器上的套接字策略文件。请参阅 http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files。 html
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