source: cheroxy/trunk/include/CRXProxy.h@ 45

Last change on this file since 45 was 45, checked in by cheese, 11 years ago

#1 change access modifier of filter and http messages

File size: 1.5 KB
Line 
1/**
2 * CRXProxy.h
3 */
4#ifndef __CRXPROXY_H__
5#define __CRXPROXY_H__
6
7#include "CRXException.h"
8#include "CRXSocket.h"
9#include "CRXHttpMessage.h"
10#include "CRXHttpRequest.h"
11#include "CRXHttpResponse.h"
12#include "CRXFilter.h"
13
14#define ERROR_PROXY -10000
15#define ERROR_PROXY_FAILED_TO_RECEIVE_REQUEST ERROR_PROXY - 1
16#define ERROR_PROXY_FAILED_TO_SEND_REQUEST ERROR_PROXY - 2
17#define ERROR_PROXY_FAILED_TO_RECEIVE_RESPONSE ERROR_PROXY - 3
18#define ERROR_PROXY_FAILED_TO_SEND_RESPONSE ERROR_PROXY - 4
19#define ERROR_PROXY_FAILED_TO_CONNECT_TO_SERVER ERROR_PROXY - 5
20#define ERROR_PROXY_FAILED_TO_SET_RESPONSE ERROR_PROXY - 6
21#define ERROR_PROXY_FAILED_TO_ACCEPT_CLIENT ERROR_PROXY - 7
22
23
24class CRXProxy : public CRXException
25{
26private:
27 CRXSocket mClient;
28 CRXSocket mServer;
29
30 int mServerTimeout;
31
32 CRXHttpRequest mHttpRequest;
33 CRXHttpResponse mHttpResponse;
34
35 static CRXFilter mFilter;
36
37public:
38 CRXProxy (const int aSocket);
39 ~CRXProxy (void);
40
41public:
42 /* common utilities */
43 void SetServerTimeout (const int aTimeout = TCPSOCKET_NO_TIMEOUT);
44 void Close (void);
45
46public:
47 /* for communication */
48 int Forward (void);
49
50 int ReceiveRequest (void);
51 int SendRequest (void);
52
53 int ReceiveResponse (void);
54 int SendResponse (void);
55
56public:
57 /* HTTP data */
58 CRXFilter & GetFilter (void) const;
59 CRXHttpRequest & GetHttpRequest (void);
60 CRXHttpResponse & GetHttpResponse (void);
61};
62
63#endif // #ifndef __CRXPROXY_H__
Note: See TracBrowser for help on using the repository browser.