无法连接到同一域中的套接字

发布于 2024-10-09 11:34:39 字数 566 浏览 0 评论 0原文

我有一个 Flex Web 应用程序(编译为常规 SWF),它尝试连接到其自己的服务器上的(二进制,而不是 XML)套接字。因此,如果 swf 位于 example.com/app.swf,则套接字为 example.com:12869

这应该是可能的,AFAIK,但是当我尝试连接时收到安全错误,指出 example.com/app.swf 无法访问 example.com:12869

尽管不需要它,我也有一个包含

<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

但它没有帮助的 crossdomain.xml 文件。

我能做些什么?

您可以在此处查看该应用。

I have a Flex web app (compiled to regular SWF) that tries to connect to a (binary, not XML) socket on its own server. So if the swf is at example.com/app.swf, the socket is example.com:12869

This should be possible, AFAIK, but when I try to connect I get a security error saying that example.com/app.swf cannot access example.com:12869.

Even though it shouldn't be needed, I also have a crossdomain.xml file containing

<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

but it doesn't help.

What can I do?

You can see the app here.

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

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

发布评论

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

评论(2

南…巷孤猫 2024-10-16 11:34:40

问题是,默认情况下 Flash 会从套接字请求策略,这意味着它会将 发送到套接字 - 如果您可以将其添加到您的服务器实现,您可以看看如何实现Guy 解决了同样的问题。

您还可以在启动套接字连接之前使用 Security.loadPolicyFile("http://axa3.axastudios.nl/crossdomain.xml") 来强制它首先加载您的策略。我不是 100% 确定这是否适用于 Socket 连接,文档(搜索“套接字策略文件”)有点令人困惑。

The thing is that by default Flash will request the policy from the socket, meaning it sends <policy-file-request/> to the Socket - if you have the possibility to add it to your server implementation, you can have a look at how that guy fixed the same sort of problem.

You can also use Security.loadPolicyFile("http://axa3.axastudios.nl/crossdomain.xml") before initiating the socket connection to force it to load your policy first. I'm not 100% sure if this works for Socket connections though, the docs (search for "Socket policy files") are slightly confusing.

吻风 2024-10-16 11:34:39

您可以使用我的 Apache 2 模块 - 它会监听在端口 843 并应答套接字策略请求

You could use my Apache 2 module - it listens at the port 843 and answers socket policy requests

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