python版的flash socket 843安全认证服务(沙箱安全配置信息的传输)

外国Coder写的:

flash policy server in py by gevent


在google下查询一下,关键字:python flash 843 crossdamon

还不小心连java版,的都找到了


也是py的


简单的demo


相关在:Apache里的配置说明:(crossdomain)


Adobe Policy File Socket Server as an Apache Module

Over the past few weeks, I've been working on an ActionScript (Flex 4.0) FTP Client.  One of the things that made life really annoying was the new stricter socket policy files, introduced in Flash 9 and mandatory in Flash 10.

According to the new rules, to allow a socket crossdomain policy to be used, you need to use Adobe's socket protocol to serve the policy file, and you can no longer use HTTP, despite the fact that it's on port 80 (under 1024).

And while Adobe was nice enoguh to provide a pair of sample servers in Perl and Python, for most sysadmins out there, that just won't cut it.

So, I went ahead and wrote a protocol module for the Apache Webserver to serve up crossdomain files via the Adobe socket protocol.  You can grab the source here.

To use it, you'll need to build it with apxs (apxs -cia mod_adobe_crossdomainpolicy.c), and configure your httpd.conf file thusly:

Firstly, you need to load the module, although the apxs command above should do that for you:

    LoadModule adobe_crossdomainpolicy_module modules/mod_adobe_crossdomainpolicy.so

Next, you'll need to bind to a port, and set up a <VirtualHost> for that port.  In this example, I'll use Adobe's standard port, 843.

  Listen 843
  <VirtualHost 0.0.0.0:843>
      AdobePolicyFileServerEnabled On
  </VirtualHost>
After starting Apache, you can test that this works by running the following from the command line (on Windows, this won't work out-of-the-box; sorry)

$ perl -e 'printf "<policy-file-request/>%c",0' | nc 127.0.0.1 843

And you should get the following output:

<?xml version='1.0'?>
<!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='*' secure='false'/>
        <allow-http-request-headers-from domain='*' headers='*' secure='false'/>
</cross-domain-policy>

That's the default super-secure locked down version of Adobe's policy.  To replace this with your own policy, just add the following directive after the "AdobePolicyFileServerEnabled on":

AdobePolicyFile /path/too/crossdomain.xml

Then restart Apache and retest, and you should get your crossdomain.xml file returned to you.

You can add as many VirtualHosts as you want (on different IP/ports) with a different file for each.

Hope this helps you!


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值