Package twisted :: Package web :: Module proxy :: Class Proxy
[show private | hide private]
[frames | no frames]

Class Proxy

BaseProtocol --+            
               |            
        Protocol --+        
                   |        
        LineReceiver --+    
                       |    
        TimeoutMixin --+    
                       |    
             HTTPChannel --+
                           |
                          Proxy


This class implements a simple web proxy.

Since it inherits from twisted.protocols.http.HTTPChannel, to use it you should do something like this:
   from twisted.protocols import http
   f = http.HTTPFactory()
   f.HTTPChannel = Proxy
Make the HTTPFactory a listener on a port as per usual, and you have a fully-functioning web proxy!
Method Summary
  __init__(self)
(inherited from HTTPChannel)
  allContentReceived(self)
(inherited from HTTPChannel)
  allHeadersReceived(self)
(inherited from HTTPChannel)
  checkPersistence(self, request, version)
Check if the channel should close or not. (inherited from HTTPChannel)
  clearLineBuffer(self)
Clear buffered data. (inherited from LineReceiver)
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
Called when the connection is shut down. (inherited from HTTPChannel)
  connectionMade(self)
Called when a connection is made. (inherited from HTTPChannel)
  dataReceived(self, data)
Protocol.dataReceived. (inherited from LineReceiver)
  headerReceived(self, line)
Do pre-processing (for content-length) and store this header away. (inherited from HTTPChannel)
  lineLengthExceeded(self, line)
Called when the maximum line length has been reached. (inherited from LineReceiver)
  lineReceived(self, line)
Override this for when each line is received. (inherited from HTTPChannel)
  rawDataReceived(self, data)
Override this for when raw data is received. (inherited from HTTPChannel)
  requestDone(self, request)
Called by first request in queue when it is done. (inherited from HTTPChannel)
  resetTimeout(self)
Reset the timeout count down (inherited from TimeoutMixin)
  sendLine(self, line)
Sends a line to the other end of the connection. (inherited from LineReceiver)
  setLineMode(self, extra)
Sets the line-mode of this receiver. (inherited from LineReceiver)
  setRawMode(self)
Sets the raw mode of this receiver. (inherited from LineReceiver)
  setTimeout(self, period)
Change the timeout period (inherited from TimeoutMixin)
  timeoutConnection(self)
Called when the connection times out. (inherited from HTTPChannel)

Class Variable Summary
class ProxyRequest

Class Variable Details

ProxyRequest

ProxyRequest = twisted.web.proxy.ProxyRequest

Generated by Epydoc 1.1 on Fri Jun 27 03:46:07 2003 http://epydoc.sf.net