From 6aefa6632023c99c5b91bae0e099df94fa69d890 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 17 May 2011 04:18:13 +0000 Subject: GatsCon now supports proxying, and way better than qtbenc ever did. Not only does it proxy, but you can inject your own messages going to the client or host. Pretty slick, really. Next up, reading and creating files. --- src/gatscon/proxythread.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/gatscon/proxythread.h (limited to 'src/gatscon/proxythread.h') diff --git a/src/gatscon/proxythread.h b/src/gatscon/proxythread.h new file mode 100644 index 0000000..df75046 --- /dev/null +++ b/src/gatscon/proxythread.h @@ -0,0 +1,60 @@ +#ifndef PROXY_THREAD_H +#define PROXY_THREAD_H + +#include + +#include +#include + +class ProxyThread : public QThread +{ + Q_OBJECT; +public: + ProxyThread( QObject *pParent, int iPortIn, const QByteArray &baHostOut, + int iPortOut ); + virtual ~ProxyThread(); + + class ProxyHostThread *pHost; + + void send( Gats::Object *pObj ); + +signals: + void recv( Gats::Object *pObj ); + void gotConnection(); + +protected: + virtual void run(); + +private: + int iPortIn; + QByteArray baHostOut; + int iPortOut; + + Bu::StreamStack ssCli; + Gats::GatsStream gsCli; +}; + +class ProxyHostThread : public QThread +{ + Q_OBJECT; +public: + ProxyHostThread( QObject *pParent, ProxyThread *pClient ); + virtual ~ProxyHostThread(); + + void send( Gats::Object *pObj ); + + void setStream( Bu::Stream *pStr ); + +signals: + void recv( Gats::Object *pObj ); + +protected: + virtual void run(); + +private: + ProxyThread *pClient; + Bu::StreamStack ssHst; + Gats::GatsStream gsHst; +}; + +#endif -- cgit v1.2.3