Kylin/HttpProxy/ProxyListener.h

22 lines
577 B
C
Raw Normal View History

2023-07-21 15:28:59 +08:00
#ifndef PROXYLISTENER_H
#define PROXYLISTENER_H
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
class ProxyListener : public std::enable_shared_from_this<ProxyListener> {
public:
ProxyListener(boost::asio::io_context &ioContext, boost::asio::ip::tcp::endpoint endpoint);
void run(boost::system::error_code &error);
protected:
void doAccept();
private:
boost::asio::io_context &m_ioContext;
boost::asio::ip::tcp::acceptor m_acceptor;
boost::asio::ip::tcp::endpoint m_endpoint;
};
#endif // PROXYLISTENER_H