forked from ravinet/mahimahi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_proxy.hh
33 lines (25 loc) · 896 Bytes
/
http_proxy.hh
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
29
30
31
32
33
/* -*-mode:c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef HTTP_PROXY_HH
#define HTTP_PROXY_HH
#include <string>
#include <queue>
#include "secure_socket.hh"
#include "socket.hh"
#include "http_record.pb.h"
#include "http_response.hh"
class HTTPProxy
{
protected:
Socket listener_socket_;
/* folder to store recorded http content in */
std::string record_folder_;
/* Pick a random file name and store reqrespair as a serialized string */
void reqres_to_protobuf( HTTP_Record::reqrespair & current_pair, const HTTPResponse & response );
public:
static const std::string client_cert;
static const std::string server_cert;
HTTPProxy( const Address & listener_addr, const std::string & record_folder );
Socket & tcp_listener( void ) { return listener_socket_; }
virtual void handle_tcp( void );
};
#endif /* HTTP_PROXY_HH */