[Twisted-Python] twisted socksv4 proxy

Yun Mao maoy at cis.upenn.edu
Tue Sep 23 22:08:48 MDT 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):
	otherConn.transport.write(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?

Thanks.

Yun





More information about the Twisted-Python mailing list