lostpencil 阅读(1020) 评论(1)
flex中

(允许访问本地8888端口)
Security.allowDomain("*");
Security.loadPolicyFile("xmlsocket://127.0.0.1:844");
socket.connect("127.0.0.1",8888);



socket加

import socketserver
class MyHandler(socketserver.BaseRequestHandler):
     def handle(self):
         while 1:
             dataReceived = self.request.recv(1024)
             if not dataReceived: break
             self.request.send(dataReceived)

         abc = """
<cross-domain-policy><allow-access-from domain="*" to-ports="8888"/></cross-domain-policy>\0"""
           self.request.send(abc)
myServer = socketserver.ThreadingTCPServer(('127.0.0.1',844), MyHandler)
myServer.serve_forever()

发表评论
切换编辑模式