wtorek, 19 stycznia 2010

simple Flash socket policy server using python Twisted

Well I was reading the articles about flashplayer socket policy.

I started wondering how many lines of code will it take to run the server with python and twisted and here it is.

from twisted.internet import reactor
from twisted.internet.protocol import Factory, Protocol

class PolicySocketProtocol(Protocol):
def dataReceived(self, data):

class PolicyFactory(Factory):
def __init__(self):
self.protocol = PolicySocketProtocol;

if __name__ == '__main__':
reactor.listenTCP(843, PolicyFactory(), interface="")

The server is running on localhost to change this simply modify "" to your host name. It's allowing to access on all ports and all domains what is not recommended for known reasons :)

1 komentarz:

  1. Casino – Odds, Tips, Stats, & Reviews - Airjordan21
    The Casino – Odds, 토토 검증 Tips, 마기 Stats, & Reviews how can i order air jordan 18 retro men blue - Airjordan21. Search to find your perfect balance of air jordan 18 retro to me events, bonuses and promotions in your how can i get jordan 18 white royal blue inbox.