1 from socket import * 2 s=socket(AF_INET,SOCK_STREAM) 3 s.bind(("localhost",6666)) 4 s.listen(1) 5 policyFile = '<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"><!-- Policy file for xmlsocket://socks.mysite.com --><cross-domain-policy><allow-access-from domain="*" to-ports="6666" /></cross-domain-policy>' 6 while 1: 7 print "waiting for connection..." 8 conn,addr=s.accept() 9 print "connection made" 10 data=conn.recv(2000) 11 print "data: ",data 12 if("policy-file-request" in data): 13 conn.send(policyFile) 14 conn.close() 15 print "connection closed."