Browse Source

Fixed #846. httpproxy.addresshelper config parameter added

pull/580/merge
orignal 8 years ago
parent
commit
7a67670e1a
  1. 1
      Config.cpp
  2. 10
      HTTPProxy.cpp

1
Config.cpp

@ -94,6 +94,7 @@ namespace config { @@ -94,6 +94,7 @@ namespace config {
("httpproxy.latency.min", value<std::string>()->default_value("0"), "HTTP proxy min latency for tunnels")
("httpproxy.latency.max", value<std::string>()->default_value("0"), "HTTP proxy max latency for tunnels")
("httpproxy.outproxy", value<std::string>()->default_value(""), "HTTP proxy upstream out proxy url")
("httpproxy.addresshelper", value<bool>()->default_value(true), "Enable or disable addresshelper")
;
options_description socksproxy("SOCKS Proxy options");

10
HTTPProxy.cpp

@ -237,7 +237,15 @@ namespace proxy { @@ -237,7 +237,15 @@ namespace proxy {
LogPrint(eLogDebug, "HTTPProxy: requested: ", m_ClientRequest.uri);
m_RequestURL.parse(m_ClientRequest.uri);
if (ExtractAddressHelper(m_RequestURL, b64)) {
if (ExtractAddressHelper(m_RequestURL, b64))
{
bool addresshelper; i2p::config::GetOption("httpproxy.addresshelper", addresshelper);
if (!addresshelper)
{
LogPrint(eLogWarning, "HTTPProxy: addresshelper disabled");
GenericProxyError("Invalid request", "adddresshelper is not supported");
return true;
}
i2p::client::context.GetAddressBook ().InsertAddress (m_RequestURL.host, b64);
LogPrint (eLogInfo, "HTTPProxy: added b64 from addresshelper for ", m_RequestURL.host);
std::string full_url = m_RequestURL.to_string();

Loading…
Cancel
Save