#include <connectionsocks5proxy.h>
Inherits ConnectionBase, and ConnectionDataHandler.
Inheritance diagram for ConnectionSOCKS5Proxy:

Public Member Functions | |
| ConnectionSOCKS5Proxy (ConnectionBase *connection, const LogSink &logInstance, const std::string &server, int port=-1, bool ip=false) | |
| ConnectionSOCKS5Proxy (ConnectionDataHandler *cdh, ConnectionBase *connection, const LogSink &logInstance, const std::string &server, int port=-1, bool ip=false) | |
| virtual | ~ConnectionSOCKS5Proxy () |
| 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, bool ip=false) |
| void | setProxyAuth (const std::string &user, const std::string &password) |
| void | setConnectionImpl (ConnectionBase *connection) |
To use with a SOCKS5 proxy:
Client* c = new Client( ... ); c->setConnectionImpl( new ConnectionSOCKS5Proxy( 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 ConnectionSOCKS5Proxy doesn't manage its own ConnectionTCP is that it allows it to be used with other transports (like IPv6 or chained HTTP/SOCKS5 proxies).
Simple plain-text username/password authentication is supported. GSSAPI authentication is not supported.
Definition at line 53 of file connectionsocks5proxy.h.
|
||||||||||||||||||||||||
|
Constructs a new ConnectionSOCKS5Proxy object.
Definition at line 45 of file connectionsocks5proxy.cpp. |
|
||||||||||||||||||||||||||||
|
Constructs a new ConnectionSOCKS5Proxy object.
Definition at line 60 of file connectionsocks5proxy.cpp. |
|
|
Virtual destructor Definition at line 76 of file connectionsocks5proxy.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 156 of file connectionsocks5proxy.cpp. |
|
|
Used to initiate the connection.
Implements ConnectionBase. Definition at line 96 of file connectionsocks5proxy.cpp. |
|
|
Disconnects an established connection. NOOP if no active connection exists. Implements ConnectionBase. Definition at line 116 of file connectionsocks5proxy.cpp. |
|
||||||||||||
|
Returns current connection statistics.
Implements ConnectionBase. Definition at line 165 of file connectionsocks5proxy.cpp. |
|
|
This function is called when e.g. the raw TCP connection was established.
Implements ConnectionDataHandler. Definition at line 333 of file connectionsocks5proxy.cpp. |
|
||||||||||||
|
This connection is called when e.g. the raw TCP connection was closed.
Implements ConnectionDataHandler. Definition at line 370 of file connectionsocks5proxy.cpp. |
|
||||||||||||
|
This function is called for received from the underlying transport.
Implements ConnectionDataHandler. Definition at line 176 of file connectionsocks5proxy.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 82 of file connectionsocks5proxy.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 131 of file connectionsocks5proxy.cpp. |
|
|
Use this periodically to receive data from the socket and to feed the parser.
Implements ConnectionBase. Definition at line 123 of file connectionsocks5proxy.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 139 of file connectionsocks5proxy.cpp. |
|
|
Sets the underlying transport connection. A possibly existing connection will be deleted.
Definition at line 88 of file connectionsocks5proxy.cpp. |
|
||||||||||||
|
Sets proxy authorization credentials.
Definition at line 142 of file connectionsocks5proxy.h. |
|
||||||||||||||||
|
Sets the server to proxy to.
Definition at line 134 of file connectionsocks5proxy.h. |
1.4.1