PSocksProtocol Class Referenceabstract

Base class for implementing the SOCKS protocol for use with PSocksSocket and PSocksUDPSocket. More...

`#include <socks.h>`

Inheritance diagram for PSocksProtocol:

## Public Types

enum | { DefaultServerPort = 1080 }

## Public Member Functions

| PSocksProtocol (WORD port)
virtual | ~PSocksProtocol ()
PBoolean | SetServer (const PString &hostname, const char *service="socks 1080")
PBoolean | SetServer (const PString &hostname, WORD port)
void | SetAuthentication (const PString &username, const PString &password)
| Set the username and password for the SOCKS server authentication. More...

## Protected Member Functions

PBoolean | ConnectSocksServer (PTCPSocket &thisSocket)
virtual void | SetErrorCodes (PChannel::Errors errCode, int osErr)=0
virtual PBoolean | SendSocksCommand (PTCPSocket &socket, BYTE command, const char *hostname, PIPSocket::Address addr)
virtual PBoolean | ReceiveSocksResponse (PTCPSocket &socket, PIPSocket::Address &addr, WORD &port)

## Protected Attributes

PString | serverHost
WORD | serverPort
PString | authenticationUsername
PString | authenticationPassword
PIPSocket::Address | remoteAddress
WORD | remotePort
PIPSocket::Address | localAddress
WORD | localPort

## Detailed Description

Base class for implementing the SOCKS protocol for use with PSocksSocket and PSocksUDPSocket.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
DefaultServerPort |

## Constructor & Destructor Documentation

## PSocksProtocol()

PSocksProtocol::PSocksProtocol | ( | WORD | port | ) |

## ~PSocksProtocol()

virtual PSocksProtocol::~PSocksProtocol | ( |  | ) |

inline virtual

## Member Function Documentation

## ConnectSocksServer()

PBoolean PSocksProtocol::ConnectSocksServer | ( | PTCPSocket & | thisSocket | ) |

protected

## ReceiveSocksResponse()

virtual PBoolean PSocksProtocol::ReceiveSocksResponse | ( | PTCPSocket & | socket,
|  | PIPSocket::Address & | addr,
|  | WORD & | port
| ) |  |

protected virtual

Reimplemented in PSocks4Socket.

## SendSocksCommand()

virtual PBoolean PSocksProtocol::SendSocksCommand | ( | PTCPSocket & | socket,
|  | BYTE | command,
|  | const char * | hostname,
|  | PIPSocket::Address | addr
| ) |  |

protected virtual

Reimplemented in PSocks4Socket.

## SetAuthentication()

void PSocksProtocol::SetAuthentication | ( | const PString & | username,
|  | const PString & | password
| ) |  |

Set the username and password for the SOCKS server authentication.

This is for the cleartext authentication only, GSSAPI, Kerberos etc is not yet supported.

## SetErrorCodes()

virtual void PSocksProtocol::SetErrorCodes | ( | PChannel::Errors | errCode,
|  | int | osErr
| ) |  |

protected pure virtual

Implemented in PSocksUDPSocket, and PSocksSocket.

## SetServer() [1/2]

PBoolean PSocksProtocol::SetServer | ( | const PString & | hostname,
|  | const char * | service = `"socks 1080"`
| ) |  |

## SetServer() [2/2]

PBoolean PSocksProtocol::SetServer | ( | const PString & | hostname,
|  | WORD | port
| ) |  |

## Member Data Documentation

## authenticationPassword

PString PSocksProtocol::authenticationPassword

protected

## authenticationUsername

PString PSocksProtocol::authenticationUsername

protected

## localAddress

PIPSocket::Address PSocksProtocol::localAddress

protected

## localPort

WORD PSocksProtocol::localPort

protected

## remoteAddress

PIPSocket::Address PSocksProtocol::remoteAddress

protected

## remotePort

WORD PSocksProtocol::remotePort

protected

## serverHost

PString PSocksProtocol::serverHost

protected

## serverPort

WORD PSocksProtocol::serverPort

protected

The documentation for this class was generated from the following file:

- socks.h