diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-05-17 04:18:13 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-05-17 04:18:13 +0000 |
commit | 6aefa6632023c99c5b91bae0e099df94fa69d890 (patch) | |
tree | 6ac83b347cc70dca827c887f0046924dabec042d /src/gatscon/proxythread.h | |
parent | efcbdb7a0347b4399cbabacf3cbea432eeafb17b (diff) | |
download | libgats-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.h | 60 |
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 | |||
9 | class ProxyThread : public QThread | ||
10 | { | ||
11 | Q_OBJECT; | ||
12 | public: | ||
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 | |||
21 | signals: | ||
22 | void recv( Gats::Object *pObj ); | ||
23 | void gotConnection(); | ||
24 | |||
25 | protected: | ||
26 | virtual void run(); | ||
27 | |||
28 | private: | ||
29 | int iPortIn; | ||
30 | QByteArray baHostOut; | ||
31 | int iPortOut; | ||
32 | |||
33 | Bu::StreamStack ssCli; | ||
34 | Gats::GatsStream gsCli; | ||
35 | }; | ||
36 | |||
37 | class ProxyHostThread : public QThread | ||
38 | { | ||
39 | Q_OBJECT; | ||
40 | public: | ||
41 | ProxyHostThread( QObject *pParent, ProxyThread *pClient ); | ||
42 | virtual ~ProxyHostThread(); | ||
43 | |||
44 | void send( Gats::Object *pObj ); | ||
45 | |||
46 | void setStream( Bu::Stream *pStr ); | ||
47 | |||
48 | signals: | ||
49 | void recv( Gats::Object *pObj ); | ||
50 | |||
51 | protected: | ||
52 | virtual void run(); | ||
53 | |||
54 | private: | ||
55 | ProxyThread *pClient; | ||
56 | Bu::StreamStack ssHst; | ||
57 | Gats::GatsStream gsHst; | ||
58 | }; | ||
59 | |||
60 | #endif | ||