acl/app/wizard_demo/httpd_proxy/http_servlet.h

40 lines
941 B
C
Raw Normal View History

#pragma once
2019-03-14 15:24:11 +08:00
class http_servlet : public acl::HttpServlet
{
public:
2022-08-26 17:51:41 +08:00
http_servlet(acl::socket_stream*, acl::session*,
acl::sslbase_conf* ssl_conf, int http_port = 80,
int https_port = 443);
2019-03-14 15:24:11 +08:00
~http_servlet();
protected:
// @override
bool doGet(request_t&, response_t&);
// @override
bool doPost(request_t&, response_t&);
// @override
bool doError(request_t&, response_t&);
// @override
bool doOther(request_t&, response_t&, const char* method);
bool doConnect(request_t&, response_t&);
private:
2022-08-26 17:51:41 +08:00
acl::sslbase_conf* ssl_conf_;
int http_port_;
int https_port_;
2019-03-14 15:24:11 +08:00
typedef bool (http_servlet::*handler_t)(request_t&,response_t&);
std::map<std::string, handler_t> handlers_;
2022-01-24 18:36:08 +08:00
bool on_hello(request_t&, response_t&);
bool transfer_get(request_t&, response_t&);
bool transfer_post(request_t&, response_t&);
2019-03-14 15:24:11 +08:00
bool transfer_tcp(acl::socket_stream& local, acl::socket_stream& peer);
2019-03-14 15:24:11 +08:00
};