Package xmpp :: Module transports :: Class HTTPPROXYsocket

[hide private]
[frames] | no frames]

# Class HTTPPROXYsocket

source code

    client.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).

Instance Methods | [hide private]

__init__(self, proxy, server, use_srv=True) Caches proxy and target addresses. | source code

plugin(self, owner) Starts connection. | source code

connect(self, dupe=None) Starts connection. | source code

DEBUG(self, text, severity) Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy". | source code

Inherited from `TCPsocket`: `disconnect`, `disconnected`, `getHost`, `getPort`, `pending_data`, `plugout`, `receive`, `send` Inherited from `client.PlugIn`: `PlugIn`, `PlugOut`

Method Details | [hide private]

### __init__(self, proxy, server, use_srv=True)
(Constructor)

source code

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: TCPsocket.__init__

### plugin(self, owner)

source code

Starts connection. Used interally. Returns non-empty string on success.

Overrides: TCPsocket.plugin

### connect(self, dupe=None)

source code

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: TCPsocket.connect

### DEBUG(self, text, severity)

source code

Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy".

Overrides: client.PlugIn.DEBUG