I2P: End-to-End encrypted and anonymous Internet https://i2pd.website/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

42 lines
776 B

#ifndef HTTP_PROXY_H__
#define HTTP_PROXY_H__
#include <sstream>
#include <thread>
#include <boost/asio.hpp>
#include <boost/array.hpp>
#include "HTTPServer.h"
namespace i2p
{
namespace proxy
{
class HTTPProxyConnection : public i2p::util::HTTPConnection
{
public:
HTTPProxyConnection (boost::asio::ip::tcp::socket * socket): HTTPConnection(socket) { };
protected:
void RunRequest();
void parseHeaders(const std::string& h, std::vector<header>& hm);
void ExtractRequest(request &m_Request);
};
class HTTPProxy : public i2p::util::HTTPServer
{
public:
HTTPProxy (int port): HTTPServer(port) {};
private:
void CreateConnection(boost::asio::ip::tcp::socket * m_NewSocket)
{
new HTTPProxyConnection(m_NewSocket);
}
};
}
}
#endif