forked from ravinet/mahimahi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp_proxy.hh
41 lines (29 loc) · 1.05 KB
/
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
34
35
36
37
38
39
40
41
/* -*-mode:c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef HTTP_PROXY_HH
#define HTTP_PROXY_HH
#include <string>
#include "socket.hh"
#include "secure_socket.hh"
#include "http_response.hh"
class HTTPBackingStore;
class EventLoop;
class Poller;
class HTTPRequestParser;
class HTTPResponseParser;
class HTTPProxy
{
private:
Socket listener_socket_;
template <class SocketType>
void loop( SocketType & server, SocketType & client, HTTPBackingStore & backing_store );
SSLContext server_context_, client_context_;
public:
HTTPProxy( const Address & listener_addr );
Socket & tcp_listener( void ) { return listener_socket_; }
void handle_tcp( HTTPBackingStore & backing_store );
/* register this HTTPProxy's TCP listener socket to handle events with
the given event_loop, saving request-response pairs to the given
backing_store (which is captured and must continue to persist) */
void register_handlers( EventLoop & event_loop, HTTPBackingStore & backing_store );
};
#endif /* HTTP_PROXY_HH */