crossdomain.xml 出现问题

发布于 2024-09-13 17:47:27 字数 2109 浏览 5 评论 0原文

我在使跨域策略发挥作用时遇到一些困难。 我在 http://www.server.com/ 上有一个 swf,它加载 XML 和其他文件。我希望能够将该 swf 嵌入到不在同一域中的其他 HTML 页面(YouTube stylee)中。通过本地服务器 http://www.server.com/my.swfhttp://www.server.com/swf.html 访问时,它工作正常但当我尝试嵌入时,它不会加载 XML 和/或给我一个安全沙箱违规

已发布的 SWF 设置为 Security.REMOTE

crossdomain.xml 允许所有:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
 <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

希望您能提供帮助

更新1

嵌入代码的示例是:

<!-- Embedding -->
<object width='400' height='300'>
<param name='movie' value='http://www.server.com/my.swf'></param>
<param name='allowFullScreen' value='true'></param>
<param name='allowscriptaccess' value='always'></param>
<param name='FlashVars' value="stream=1281002679" ></param>
<embed src='http://www.server.com/my.swf' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='400' height='300'></embed>
</object>

...可以添加到任何域上的任何网页

更新

2policyfiles.txt(192.168.100.55是我包含嵌入示例的本地测试服务器):

OK: Root-level SWF loaded: http://www.server.com/my.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.

flashlog.txt提炼 警告:无法从 http://192.168.100.55/crossdomain.xml 加载策略文件

我是否需要通过 Security.loadPolicyFile('http://www. server.com/crossdmoain.xml')??

I'm having some difficulty getting my cross domain policy to work.
I have an swf at http://www.server.com/ that loads in XML and other files. I want to be able to embed that swf in other HTML pages (YouTube stylee) that aren't in the same domain. It works fine when access via it's local server http://www.server.com/my.swf or http://www.server.com/swf.html but when I try to embed it won't load the XMLs and/or gives me a Security sandbox violation

The published SWF is set to Security.REMOTE

crossdomain.xml allows all:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
 <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

Hope you can help

UPDATE 1

An example of the embed code is:

<!-- Embedding -->
<object width='400' height='300'>
<param name='movie' value='http://www.server.com/my.swf'></param>
<param name='allowFullScreen' value='true'></param>
<param name='allowscriptaccess' value='always'></param>
<param name='FlashVars' value="stream=1281002679" ></param>
<embed src='http://www.server.com/my.swf' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='400' height='300'></embed>
</object>

... which could be added to any webpage on any domain

UPDATE 2

policyfiles.txt (192.168.100.55 is my local testing server containing embedded example):

OK: Root-level SWF loaded: http://www.server.com/my.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.

flashlog.txt extract
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml

Do I need to load the crossdomain.xml via Security.loadPolicyFile('http://www.server.com/crossdmoain.xml')??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

污味仙女 2024-09-20 17:47:27

错误:请求资源 http://192.168.100.55/data/configuration .xml?refresh=0.2777715688571334 由来自 http://www.server.com/my 的请求者.swf 由于缺乏策略文件权限而被拒绝。

看起来您的 swf 尝试从本地服务器而不是 www.server.com 加载配置文件

您应该使用绝对路径

error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.

It looks like your swf tries to load the configuration file from your local server instead of your www.server.com

You should use an absolute path

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文