[Socket + amf3] solutions to socket security policy problems

Source: Internet
Author: User

Flash Player Security Policy and port problems have always been a headache for web development of socket (xmlsocket). After a day of research yesterday, we finally found a solution, I will briefly describe the solution here!
In fact, flash help files are also explained: http://help.adobe.com/zh_CN/AS3LCR/Flash_10.0/flash/system/Security.html#loadPolicyFile ()
. The security. loadpolicyfile ("xmlsocket: // localhost: 110") is used to load the security policy content before the socket. Connect method is called. The player sends a request to the server <policy-file-Request/>
And ends with NULL bytes. The server also returns the security policy content terminated with NULL bytes.
The security policy text is as follows:
<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype cross-domain-Policy System "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd
">
<Cross-domain-Policy>
<Site-control permitted-Cross-Domain-policies = "all"/>
<Allow-access-from domain = "*" to-ports = "*"/>
</Cross-Domain-Policy>
On the server side, we need to make a difference with amf3. Check whether the request contains "<policy-file-Request/>
", And then return the Security Policy text content. Note that the returned content must be ended in NULL bytes!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.