/ libi2pd_client / HTTPProxy.h
HTTPProxy.h
 1  /*
 2  * Copyright (c) 2013-2024, The PurpleI2P Project
 3  *
 4  * This file is part of Purple i2pd project and licensed under BSD3
 5  *
 6  * See full license text in LICENSE file at top of project tree
 7  */
 8  
 9  #ifndef HTTP_PROXY_H__
10  #define HTTP_PROXY_H__
11  
12  namespace i2p {
13  namespace proxy {
14  	class HTTPProxy: public i2p::client::TCPIPAcceptor
15  	{
16  		public:
17  
18  			HTTPProxy(const std::string& name, const std::string& address, uint16_t port, const std::string & outproxy, 
19  				bool addresshelper, bool senduseragent, std::shared_ptr<i2p::client::ClientDestination> localDestination);
20  			HTTPProxy(const std::string& name, const std::string& address, uint16_t port, std::shared_ptr<i2p::client::ClientDestination> localDestination = nullptr) :
21  				HTTPProxy(name, address, port, "", true, false, localDestination) {} ;
22  			~HTTPProxy() {};
23  
24  			std::string GetOutproxyURL() const { return m_OutproxyUrl; }
25  			bool GetHelperSupport() const { return m_Addresshelper; }
26  			bool GetSendUserAgent () const { return m_SendUserAgent; }
27  
28  		protected:
29  
30  			// Implements TCPIPAcceptor
31  			std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
32  			const char* GetName() { return m_Name.c_str (); }
33  
34  		private:
35  
36  			std::string m_Name;
37  			std::string m_OutproxyUrl;
38  			bool m_Addresshelper, m_SendUserAgent;
39  	};
40  } // http
41  } // i2p
42  
43  #endif