#ifndef PROXYHTTPSESSION_H #define PROXYHTTPSESSION_H #include #include #include #include #include class ProxyHttpSession : public std::enable_shared_from_this { public: ProxyHttpSession(boost::asio::io_context &ioContext, boost::asio::ip::tcp::socket &&socket); void run(); protected: void doRead(); void onRead(boost::beast::error_code ec, std::size_t); private: boost::asio::ip::tcp::resolver m_resolver; std::optional> m_parser; boost::beast::flat_buffer m_buffer{std::numeric_limits::max()}; boost::beast::tcp_stream m_clientStream; boost::beast::tcp_stream m_serverStream; }; #endif // PROXYHTTPSESSION_H