TorSocket Class Reference

#include <torsocket.h>

List of all members.

Signals

void connectedToTor ()
void connectedToHost ()
void socketError (QString errmsg)

Public Member Functions

 TorSocket (QHostAddress socksAddr, quint16 socksPort, QObject *parent=0)
void connectToHost (const QString &remoteHost, quint16 remotePort)

Private Slots

void onHandshakeResponse ()
void onError (QAbstractSocket::SocketError error)

Private Member Functions

void sendSocksHandshake (const QString &remoteHost, quint16 remotePort)

Private Attributes

QHostAddress _socksAddr
quint16 _socksPort


Detailed Description

Definition at line 35 of file torsocket.h.


Constructor & Destructor Documentation

TorSocket::TorSocket ( QHostAddress  socksAddr,
quint16  socksPort,
QObject *  parent = 0 
)

Constructor.

Definition at line 42 of file torsocket.cpp.

References onError().


Member Function Documentation

void TorSocket::connectToHost ( const QString &  remoteHost,
quint16  remotePort 
)

Connects to the specified hostname and port via Tor.

Definition at line 53 of file torsocket.cpp.

References _socksAddr, _socksPort, connectedToTor(), LOCAL_CONNECT_TIMEOUT, onHandshakeResponse(), and sendSocksHandshake().

Referenced by GeoIpResolver::resolve().

void TorSocket::connectedToTor (  )  [signal]

Emitted when a connection has been established to Tor.

Referenced by connectToHost().

void TorSocket::connectedToHost (  )  [signal]

Emitted when a connection has been established through Tor to the remote host specified in a prior call to connectToHost().

Referenced by onHandshakeResponse().

void TorSocket::socketError ( QString  errmsg  )  [signal]

Emmitted when a connection error has occurred.

Referenced by onError().

void TorSocket::onHandshakeResponse (  )  [private, slot]

Handles the server's response part of a Socks4a handshake.

Definition at line 112 of file torsocket.cpp.

References connectedToHost(), SOCKS_CONNECT_STATUS_OK, SOCKS_RESPONSE_LEN, and SOCKS_RESPONSE_VERSION.

Referenced by connectToHost().

void TorSocket::onError ( QAbstractSocket::SocketError  error  )  [private, slot]

Called when a connection error has occurred.

Definition at line 72 of file torsocket.cpp.

References socketError().

Referenced by TorSocket().

void TorSocket::sendSocksHandshake ( const QString &  remoteHost,
quint16  remotePort 
) [private]

Sends the client part of a Socks4a handshake with a proxy server.

Definition at line 91 of file torsocket.cpp.

References SOCKS_CONNECT, SOCKS_FAKE_IP, and SOCKS_VERSION.

Referenced by connectToHost().


Member Data Documentation

QHostAddress TorSocket::_socksAddr [private]

Address of Tor's SOCKS listener.

Definition at line 65 of file torsocket.h.

Referenced by connectToHost().

quint16 TorSocket::_socksPort [private]

Port of Tor's SOCKS listener.

Definition at line 66 of file torsocket.h.

Referenced by connectToHost().


The documentation for this class was generated from the following files:
Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0