sockoutproxy params added

pull/347/head
orignal 9 years ago
parent f7e21dbe5c
commit 0c9ce6258c

@ -53,8 +53,10 @@ namespace client
std::string socksProxyAddr = i2p::util::config::GetArg("-socksproxyaddress", "127.0.0.1");
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);
m_SocksProxy = new i2p::proxy::SOCKSProxy(socksProxyAddr, socksProxyPort, localDestination);
m_SocksProxy = new i2p::proxy::SOCKSProxy(socksProxyAddr, socksProxyPort, socksOutProxyAddr, socksOutProxyPort, localDestination);
m_SocksProxy->Start();
// I2P tunnels

@ -182,7 +182,8 @@ namespace proxy
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
http_buff[len] = 0;
@ -195,7 +196,7 @@ namespace proxy
strncpy(start, end, (char *)(http_buff + len) - end);
len -= (end - start);
}
}
}*/
while (len > 0)
{

@ -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 ())
{
}

@ -15,7 +15,8 @@ namespace proxy
{
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() {};
protected:

Loading…
Cancel
Save