Kylin/HttpProxy/ProxyTcpSession.h

25 lines
616 B
C
Raw Normal View History

2023-07-21 15:28:59 +08:00
#ifndef PROXYTCPSESSION_H
#define PROXYTCPSESSION_H
#include <boost/asio/ip/tcp.hpp>
class ProxyTcpSession : public std::enable_shared_from_this<ProxyTcpSession> {
public:
ProxyTcpSession(boost::asio::ip::tcp::socket &&client, boost::asio::ip::tcp::socket &&server);
~ProxyTcpSession();
void run();
protected:
void clientRead();
void serverRead();
private:
boost::asio::ip::tcp::socket m_client;
boost::asio::ip::tcp::socket m_server;
std::array<uint8_t, 4096> m_clientBuffer;
std::array<uint8_t, 4096> m_serverBuffer;
};
#endif // PROXYTCPSESSION_H