25 lines
616 B
C++
25 lines
616 B
C++
#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
|