forked from kingst/twproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCache.h
28 lines (20 loc) · 838 Bytes
/
Cache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _CACHE_H_
#define _CACHE_H_
#include <string>
#include "MySocket.h"
class Cache {
public:
Cache();
//XXX: Note that host and url for https are NOT real ones here.
//They are the one in CONNECT message, thus only a domain name for url.
//I need real one for voting purpose, I can get them after enableSSL
//functions are called, by calling request->getUrl() again.
void getHTTPResponse(std::string host, std::string request, std::string url,
int serverPort, MySocket *browserSock, bool isTunnel);
protected:
void handleResponse(MySocket *browserSock, MySocket *replySock, std::string request);
void handleTunnel(MySocket *browserSock, MySocket *replySock);
bool copyNetBytes(MySocket *readSock, MySocket *writeSock);
};
Cache *cache();
#endif