aboutsummaryrefslogtreecommitdiff
path: root/src/gatscon/proxythread.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-05-17 04:18:13 +0000
committerMike Buland <eichlan@xagasoft.com>2011-05-17 04:18:13 +0000
commit6aefa6632023c99c5b91bae0e099df94fa69d890 (patch)
tree6ac83b347cc70dca827c887f0046924dabec042d /src/gatscon/proxythread.h
parentefcbdb7a0347b4399cbabacf3cbea432eeafb17b (diff)
downloadlibgats-6aefa6632023c99c5b91bae0e099df94fa69d890.tar.gz
libgats-6aefa6632023c99c5b91bae0e099df94fa69d890.tar.bz2
libgats-6aefa6632023c99c5b91bae0e099df94fa69d890.tar.xz
libgats-6aefa6632023c99c5b91bae0e099df94fa69d890.zip
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.
Diffstat (limited to 'src/gatscon/proxythread.h')
-rw-r--r--src/gatscon/proxythread.h60
1 files changed, 60 insertions, 0 deletions
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 @@
1#ifndef PROXY_THREAD_H
2#define PROXY_THREAD_H
3
4#include <QThread>
5
6#include <bu/streamstack.h>
7#include <gats/gatsstream.h>
8
9class ProxyThread : public QThread
10{
11 Q_OBJECT;
12public:
13 ProxyThread( QObject *pParent, int iPortIn, const QByteArray &baHostOut,
14 int iPortOut );
15 virtual ~ProxyThread();
16
17 class ProxyHostThread *pHost;
18
19 void send( Gats::Object *pObj );
20
21signals:
22 void recv( Gats::Object *pObj );
23 void gotConnection();
24
25protected:
26 virtual void run();
27
28private:
29 int iPortIn;
30 QByteArray baHostOut;
31 int iPortOut;
32
33 Bu::StreamStack ssCli;
34 Gats::GatsStream gsCli;
35};
36
37class ProxyHostThread : public QThread
38{
39 Q_OBJECT;
40public:
41 ProxyHostThread( QObject *pParent, ProxyThread *pClient );
42 virtual ~ProxyHostThread();
43
44 void send( Gats::Object *pObj );
45
46 void setStream( Bu::Stream *pStr );
47
48signals:
49 void recv( Gats::Object *pObj );
50
51protected:
52 virtual void run();
53
54private:
55 ProxyThread *pClient;
56 Bu::StreamStack ssHst;
57 Gats::GatsStream gsHst;
58};
59
60#endif