[Twisted-Python] twisted socksv4 proxy

Yun Mao maoy at cis.upenn.edu
Wed Sep 24 00:08:48 EDT 2003

I tried to use twisted python to write a proxy following the given 
socksv4 example. 

The problem i discovered is that: when i try to forward two connections, 
their capacities may not match. 

In a blocking implementation, 
           data = source.read(); dest.write(data);

In a non-blocking implementation, what socksv4 did is something like:

   def dataReceived(data):

However, if source is a much faster link than dest, would there be a 
problem? write always return even it should block so that read always 
happens, and the buffer of source tcp connection will never get full, to 
let tcp start flow control?



More information about the Twisted-Python mailing list