#include <connectionhttpproxy.h>
Inherits ConnectionBase, and ConnectionDataHandler.
Inheritance diagram for ConnectionHTTPProxy:


Public Member Functions | |
| ConnectionHTTPProxy (ConnectionBase *connection, const LogSink &logInstance, const std::string &server, int port=-1) | |
| ConnectionHTTPProxy (ConnectionDataHandler *cdh, ConnectionBase *connection, const LogSink &logInstance, const std::string &server, int port=-1) | |
| virtual | ~ConnectionHTTPProxy () |
| virtual ConnectionError | connect () |
| virtual ConnectionError | recv (int timeout=-1) |
| virtual bool | send (const std::string &data) |
| virtual ConnectionError | receive () |
| virtual void | disconnect () |
| virtual void | cleanup () |
| virtual void | getStatistics (int &totalIn, int &totalOut) |
| virtual void | handleReceivedData (const ConnectionBase *connection, const std::string &data) |
| virtual void | handleConnect (const ConnectionBase *connection) |
| virtual void | handleDisconnect (const ConnectionBase *connection, ConnectionError reason) |
| virtual ConnectionBase * | newInstance () const |
| void | setServer (const std::string &host, int port=-1) |
| void | setProxyAuth (const std::string &user, const std::string &password) |
| void | setConnectionImpl (ConnectionBase *connection) |
| void | setHTTP11 (bool http11) |
Usage:
Client *c = new Client( ... ); c->setConnectionImpl( new ConnectionHTTPProxy( c, new ConnectionTCP( c->logInstance(), proxyHost, proxyPort ), c->logInstance(), xmppHost, xmppPort ) );
Make sure to pass the proxy host/port to the transport connection (ConnectionTCP in this case), and the XMPP host/port to the proxy connection.
The reason why ConnectionHTTPProxy doesn't manage its own ConnectionTCP is that it allows it to be used with other transports (like IPv6 or chained SOCKS5/HTTP proxies).
Definition at line 47 of file connectionhttpproxy.h.
|
||||||||||||||||||||
|
Constructs a new ConnectionHTTPProxy object.
Definition at line 32 of file connectionhttpproxy.cpp. |
|
||||||||||||||||||||||||
|
Constructs a new ConnectionHTTPProxy object.
Definition at line 44 of file connectionhttpproxy.cpp. |
|
|
Virtual destructor Definition at line 57 of file connectionhttpproxy.cpp. |
|
|
This function is called after a disconnect to clean up internal state. It is also called by ConnectionBase's destructor. Reimplemented from ConnectionBase. Definition at line 119 of file connectionhttpproxy.cpp. |
|
|
Used to initiate the connection.
Implements ConnectionBase. Definition at line 77 of file connectionhttpproxy.cpp. |
|
|
Disconnects an established connection. NOOP if no active connection exists. Implements ConnectionBase. Definition at line 88 of file connectionhttpproxy.cpp. |
|
||||||||||||
|
Returns current connection statistics.
Implements ConnectionBase. Definition at line 127 of file connectionhttpproxy.cpp. |
|
|
This function is called when e.g. the raw TCP connection was established.
Implements ConnectionDataHandler. Definition at line 173 of file connectionhttpproxy.cpp. |
|
||||||||||||
|
This connection is called when e.g. the raw TCP connection was closed.
Implements ConnectionDataHandler. Definition at line 215 of file connectionhttpproxy.cpp. |
|
||||||||||||
|
This function is called for received from the underlying transport.
Implements ConnectionDataHandler. Definition at line 138 of file connectionhttpproxy.cpp. |
|
|
This function returns a new instance of the current ConnectionBase-derived object. The idea is to be able to 'clone' ConnectionBase-derived objects without knowing of what type they are exactly.
Implements ConnectionBase. Definition at line 63 of file connectionhttpproxy.cpp. |
|
|
Use this function to put the connection into 'receive mode', i.e. this function returns only when the connection is terminated.
Implements ConnectionBase. Definition at line 103 of file connectionhttpproxy.cpp. |
|
|
Use this periodically to receive data from the socket and to feed the parser.
Implements ConnectionBase. Definition at line 95 of file connectionhttpproxy.cpp. |
|
|
Use this function to send a string of data over the wire. The function returns only after all data has been sent.
Implements ConnectionBase. Definition at line 111 of file connectionhttpproxy.cpp. |
|
|
Sets the underlying transport connection. A possibly existing connection will be deleted.
Definition at line 69 of file connectionhttpproxy.cpp. |
|
|
Switches usage of HTTP/1.1 on or off.
Definition at line 147 of file connectionhttpproxy.h. |
|
||||||||||||
|
Sets proxy authorization credentials.
Definition at line 133 of file connectionhttpproxy.h. |
|
||||||||||||
|
Sets the XMPP server to proxy to.
Reimplemented from ConnectionBase. Definition at line 125 of file connectionhttpproxy.h. |
1.4.1