开发者

Security sandbox question: how to test locally with remote files?

If I have a flash file that I'd like to开发者_StackOverflow中文版 test locally (on my computer) but I have video files on a flash video server and photos on another server, is there an easy way to set up my flash file so I can do this?


If you have access to the remote servers, you need to upload a CrossDomain.xml file to the root of their webserver, allowing access to your machine:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <!-- Use one of the following:  -->
    <allow-access-from domain="*.example.com"/>  <!-- Your domain -->
    <allow-access-from domain="192.168.0.0"/> <!-- Your IP address -->
</cross-domain-policy>

If you don't have access, you need to set up a proxy - ie., a local server which will forward your requests through to the destination server. A little more complex, but tools such as LCDS or BlazeDS will do this for you.

More information on CrossDomain files available here: http://learn.adobe.com/wiki/download/attachments/64389123/CrossDomain_PolicyFile_Specification.pdf?version=1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜