18 #include <QDataStream>
20 #define SOCKS_VERSION 0x04
21 #define SOCKS_CONNECT 0x01
22 #define SOCKS_FAKE_IP 0x00000001
23 #define SOCKS_RESPONSE_LEN 0x08
24 #define SOCKS_RESPONSE_VERSION 0x00
25 #define SOCKS_CONNECT_STATUS_OK 0x5A
30 quint16 socksPort, QObject *parent)
32 _socksAddr(socksAddr),
35 QObject::connect(
this, SIGNAL(
error(QAbstractSocket::SocketError)),
36 this, SLOT(
onError(QAbstractSocket::SocketError)));
37 QObject::connect(
this, SIGNAL(readyRead()),
39 QObject::connect(
this, SIGNAL(connected()),
83 QDataStream sock(
this);
86 sock << (quint16)remotePort;
89 sock.writeRawData(qPrintable(remoteHost), remoteHost.length());
107 QObject::disconnect(
this, SIGNAL(readyRead()),
120 disconnectFromHost();