mirror of https://github.com/PurpleI2P/i2pd.git
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.
41 lines
890 B
41 lines
890 B
10 years ago
|
#ifndef SOCKS_H__
|
||
|
#define SOCKS_H__
|
||
10 years ago
|
|
||
10 years ago
|
#include <memory>
|
||
10 years ago
|
#include <set>
|
||
10 years ago
|
#include <boost/asio.hpp>
|
||
10 years ago
|
#include <mutex>
|
||
10 years ago
|
#include "I2PService.h"
|
||
10 years ago
|
|
||
|
namespace i2p
|
||
|
{
|
||
|
namespace proxy
|
||
|
{
|
||
10 years ago
|
class SOCKSServer: public i2p::client::TCPIPAcceptor
|
||
10 years ago
|
{
|
||
10 years ago
|
public:
|
||
|
|
||
9 years ago
|
SOCKSServer(const std::string& address, int port, const std::string& outAddress, uint16_t outPort,
|
||
9 years ago
|
std::shared_ptr<i2p::client::ClientDestination> localDestination = nullptr);
|
||
10 years ago
|
~SOCKSServer() {};
|
||
|
|
||
9 years ago
|
void SetUpstreamProxy(const std::string & addr, const uint16_t port);
|
||
|
|
||
10 years ago
|
protected:
|
||
|
// Implements TCPIPAcceptor
|
||
10 years ago
|
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
|
||
10 years ago
|
const char* GetName() { return "SOCKS"; }
|
||
9 years ago
|
|
||
|
private:
|
||
|
std::string m_UpstreamProxyAddress;
|
||
|
uint16_t m_UpstreamProxyPort;
|
||
|
bool m_UseUpstreamProxy;
|
||
10 years ago
|
};
|
||
10 years ago
|
|
||
10 years ago
|
typedef SOCKSServer SOCKSProxy;
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif
|