Portforwarding using Twisted, Python

This is a very short proxy written in Python using Twisted 1.3. It forwards port 1080 to localhost:80. from twisted.internet import reactor from twisted.protocols import portforward def server_dataReceived(self, data): print ‘Server received data:’, data portforward.Proxy.dataReceived(self, data) portforward.ProxyServer.dataReceived = server_dataReceived def client_dataReceived(self, data): print ‘Client received data:’, data portforward.Proxy.dataReceived(self, data) portforward.ProxyClient.dataReceived = client_dataReceived reactor.listenTCP(1080, portforward.ProxyFactory(‘localhost’, 80)) …

Continue reading ‘Portforwarding using Twisted, Python’ »

Share