Package xmpp :: Module transports :: Class HTTPPROXYsocket
[show private | hide private]
[frames | no frames]

Class HTTPPROXYsocket

PlugIn --+    
         |    
 TCPsocket --+
             |
            HTTPPROXYsocket


HTTP (CONNECT) proxy connection class. Uses TCPsocket as the base class redefines only connect method. Allows to use HTTP proxies like squid with (optionally) simple authentication (using login and password).
Method Summary
  __init__(self, proxy, server)
Caches proxy and target addresses.
  connect(self, dupe)
Starts connection.
  DEBUG(self, text, severity)
  plugin(self, owner)
Starts connection.
    Inherited from TCPsocket
  disconnect(self)
Closes the socket.
  disconnected(self)
Called when a Network Error or disconnection occurs.
  getHost(self)
Return the 'host' value that is connection is [will be] made to.
  getPort(self)
Return the 'port' value that is connection is [will be] made to.
  pending_data(self, timeout)
Returns true if there is a data ready to be read.
  plugout(self)
Disconnect from the remote server and unregister self.disconnected method from the owner's dispatcher.
  receive(self)
Reads all pending incoming data.
  send(self, raw_data)
Writes raw outgoing data.
    Inherited from PlugIn
  PlugIn(self, owner)
Attach to main instance and register ourself and all our staff in it.
  PlugOut(self)
Unregister all our staff from main instance and detach from it.

Method Details

__init__(self, proxy, server)
(Constructor)

Caches proxy and target addresses. 'proxy' argument is a dictionary with mandatory keys 'host' and 'port' (proxy address) and optional keys 'user' and 'password' to use for authentication. 'server' argument is a tuple of host and port - just like TCPsocket uses.
Overrides:
xmpp.transports.TCPsocket.__init__

connect(self, dupe=None)

Starts connection. Connects to proxy, supplies login and password to it (if were specified while creating instance). Instructs proxy to make connection to the target server. Returns non-empty sting on success.
Overrides:
xmpp.transports.TCPsocket.connect

plugin(self, owner)

Starts connection. Used interally. Returns non-empty string on success.
Overrides:
xmpp.transports.TCPsocket.plugin

Generated by Epydoc 2.1 on Sun Dec 26 09:52:56 2004 http://epydoc.sf.net