Flex/AS3 和 AppEngine 的安全沙箱问题
我在处理 App Engine 上托管的 AS3 AMF RemoteObject 请求时遇到问题。我在域的根目录中有一个 crossdomain.xml 文件,在远程处理端点也有一个文件。
以下是根 crossdomain.xml 的内容:
<跨域策略>
<站点控制允许的跨域策略 ="全部"/>
我已将应用程序的 ID 替换为 {appid}。在端点 crossdomain.xml 中,它表示完全相同的内容,只是省略了
标记。
加载 swf 文件并在我的机器上测试它效果很好...我认为这可能与我拥有 Flash Player 的调试器版本有关。当我将其推送到 App Engine 使其公开时,其他客户端访问它并收到 Client.Error.MessageSend Channel.Security.Error 错误 Error #2048 url: http://05-alpha.latest.{ appid}.appspot.com/_rpc/data
。
我正在使用 Flex 4 beta 和 App Engine Python 运行时。我尝试过跨域中的完整通配符,甚至通过相对 URL 访问数据端点以避免此错误。
请有人帮忙!提前致谢。
I'm having trouble with an AS3 AMF RemoteObject request that is hosted on App Engine. I have a crossdomain.xml file in the root of the domain, and also one at the remoting endpoint.
Here are the contents of the root crossdomain.xml:
<?xml version="1.0"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies ="all"/>
<allow-access-from domain="*.appspot.com"/>
<allow-access-from domain="*.{appid}.appspot.com"/>
<allow-access-from domain="*.{appid}.com"/>
<allow-access-from domain="*.{appid}.org"/>
</cross-domain-policy>
I have replaced my application's ID with {appid}. In the endpoint crossdomain.xml, it says the exact same thing, except it omits the <site-control>
tag.
Loading the swf file and testing it on my machine works just fine... I think that may have something to do with me having the debugger version of Flash Player. When I push it up to App Engine to make it public, other clients access it and get a Client.Error.MessageSend Channel.Security.Error error Error #2048 url: http://05-alpha.latest.{appid}.appspot.com/_rpc/data
.
I am using Flex 4 beta, and the App Engine Python runtime. I have tried full wildcard in the crossdomain, and even accessing the data endpoint at a relative URL so as to avoid this error.
Someone please help! Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此问题涉及 Flex Builder 和 Flex Builder for Eclipse 插件。
如果您在运行项目时启用了网络监控(这是一项非常有用的功能,可让您监控通过网络传输的数据),Builder 会自动修改您的 SWF,以通过本地计算机上运行的服务器重定向流量这样你就可以监控它。
要解决此问题,请在编译项目时禁用网络监控。
Adobe 确实应该解决这个问题...很容易忘记监控功能已打开,因为我认识的大多数开发人员都一直将其打开。
有关网络监视器的更多信息: http://anirudhs.chaosnet。 org/blog/2009.06.01.html
This problem deals with Flex Builder and the Flex Builder plugin for Eclipse.
If you have Network Monitoring on when you run your project (an extremely useful feature that lets you monitor data moving over the wire), Builder automatically modifies your SWF to redirect traffic through a server running on your local machine so you can monitor it.
To fix the problem, disable Network Monitoring when you compile your project.
Adobe really should fix this issue... it's easy to forget that monitoring is on since most developers I know leave it on all the time.
More info about Network Monitor: http://anirudhs.chaosnet.org/blog/2009.06.01.html