Browse Source

sockoutproxy params added

pull/347/head
orignal 9 years ago
parent
commit
0c9ce6258c
  1. 4
      ClientContext.cpp
  2. 5
      HTTPProxy.cpp
  3. 3
      SOCKS.cpp
  4. 3
      SOCKS.h

4
ClientContext.cpp

@ -53,8 +53,10 @@ namespace client
std::string socksProxyAddr = i2p::util::config::GetArg("-socksproxyaddress", "127.0.0.1"); std::string socksProxyAddr = i2p::util::config::GetArg("-socksproxyaddress", "127.0.0.1");
uint16_t socksProxyPort = i2p::util::config::GetArg("-socksproxyport", 4447); uint16_t socksProxyPort = i2p::util::config::GetArg("-socksproxyport", 4447);
std::string socksOutProxyAddr = i2p::util::config::GetArg("-socksoutproxyaddress", "");
uint16_t socksOutProxyPort = i2p::util::config::GetArg("-socksoutproxyport", 0);
LogPrint(eLogInfo, "Clients: starting SOCKS Proxy at ", socksProxyAddr, ":", socksProxyPort); LogPrint(eLogInfo, "Clients: starting SOCKS Proxy at ", socksProxyAddr, ":", socksProxyPort);
m_SocksProxy = new i2p::proxy::SOCKSProxy(socksProxyAddr, socksProxyPort, localDestination); m_SocksProxy = new i2p::proxy::SOCKSProxy(socksProxyAddr, socksProxyPort, socksOutProxyAddr, socksOutProxyPort, localDestination);
m_SocksProxy->Start(); m_SocksProxy->Start();
// I2P tunnels // I2P tunnels

5
HTTPProxy.cpp

@ -182,7 +182,8 @@ namespace proxy
bool HTTPProxyHandler::HandleData(uint8_t *http_buff, std::size_t len) bool HTTPProxyHandler::HandleData(uint8_t *http_buff, std::size_t len)
{ {
assert(len); // This should always be called with a least a byte left to parse // TODO: we should srtrip 'Referer' better, because it might be inside message body
/*assert(len); // This should always be called with a least a byte left to parse
// remove "Referer" from http requst // remove "Referer" from http requst
http_buff[len] = 0; http_buff[len] = 0;
@ -195,7 +196,7 @@ namespace proxy
strncpy(start, end, (char *)(http_buff + len) - end); strncpy(start, end, (char *)(http_buff + len) - end);
len -= (end - start); len -= (end - start);
} }
} }*/
while (len > 0) while (len > 0)
{ {

3
SOCKS.cpp

@ -557,7 +557,8 @@ namespace proxy
} }
} }
SOCKSServer::SOCKSServer(const std::string& address, int port, std::shared_ptr<i2p::client::ClientDestination> localDestination) : SOCKSServer::SOCKSServer(const std::string& address, int port, const std::string& outAddress, int outPort,
std::shared_ptr<i2p::client::ClientDestination> localDestination) :
TCPIPAcceptor (address, port, localDestination ? localDestination : i2p::client::context.GetSharedLocalDestination ()) TCPIPAcceptor (address, port, localDestination ? localDestination : i2p::client::context.GetSharedLocalDestination ())
{ {
} }

3
SOCKS.h

@ -15,7 +15,8 @@ namespace proxy
{ {
public: public:
SOCKSServer(const std::string& address, int port, std::shared_ptr<i2p::client::ClientDestination> localDestination = nullptr); SOCKSServer(const std::string& address, int port, const std::string& outAddress, int outPort,
std::shared_ptr<i2p::client::ClientDestination> localDestination = nullptr);
~SOCKSServer() {}; ~SOCKSServer() {};
protected: protected:

Loading…
Cancel
Save