帮助跨域文件的ActionScript 3插座 [英] Help with Cross-Domain file for ActionScript 3 Socket

查看:110
本文介绍了帮助跨域文件的ActionScript 3插座的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的动作code:

Here is My ActionScript Code:

  var S:Socket=new Socket("127.0.0.1",2222);

下面是我的crossdomain.xml文件(位于 http://127.0.0.1/crossdomain.xml

Here is My CrossDomain.XML File (Located at http://127.0.0.1/crossdomain.xml)

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

下面是我收到错误

  Ignoring policy file at xmlsocket://127.0.0.1:2222 due to incorrect syntax. 

从未使用过的人之前,我不明白这有什么错我的跨域文件的语法。

Having never used one before, I don't understand what's wrong with the syntax of my CrossDomain file.

请帮助。

推荐答案

套接字策略文件的工作中有点不一样的HTTP策略文件;特别是,它们不是通过HTTP服,或通过端口80

Socket policy files work a little differently than HTTP policy files; in particular, they aren't served via HTTP, or at port 80.

相反,Flash Player将在策略文件服务器(端口843默认情况下),或者如果有必要,在你打开插座(对你来说,端口2222)。

Instead, Flash Player checks for a policy file server (port 843 by default), or if necessary, on the socket you're opening (for you, port 2222).

一个策略文件服务器是一个套接字这是为了响应&LT;政策性文件的请求/&GT; 与一个有效的策略文件。这是怎么回事您的邮件,很可能是它是从2222端口发送的请求,并获得比政策文件等东西回来,因此无效的语法。

A policy file server is a socket which responds to a <policy-file-request/> with a valid policy file. What's happening with your message is likely that it's sending its request and getting something other than a policy file back, hence invalid syntax from port 2222.

有很多的资源在那里,一些问题在这里对SO 。这里是从Adobe 1教程

There are a lot of resources out there, and a number of questions here on SO. Here's one tutorial from Adobe.

这篇关于帮助跨域文件的ActionScript 3插座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆