#pragma once #include "http_define.h" #if USE_NET_HTTP_UTIL #include #include #include #include "http_interface.h" #include "util/array.hpp" namespace ylib { namespace network { namespace http { class server; class router; class host; class agent; class website :public ylib::error_base, public network::http::interface_ { public: public: website(); ~website(); /****************************************************************** * function:启动 * param * config : 配置项 * return: * 失败可通过 last_error() 返回错误信息。 ******************************************************************/ bool start(const website_config& config); /****************************************************************** * function:关闭 ******************************************************************/ void close(); network::http::router* router(); const website_config& config() { return m_config; } bool host(const std::string& host); bool is_catchall() const; ylib::nolock_array* proxy(); private: // router路由 服务 network::http::router* m_router = nullptr; // HOST std::vector m_hosts; // HTTPS bool m_https = false; // 反向代理 ylib::nolock_array m_proxy; // 配置 website_config m_config; }; } } } #endif