mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 16:34:13 +00:00
Fixed #846. httpproxy.addresshelper config parameter added
This commit is contained in:
parent
539bf482b9
commit
7a67670e1a
@ -94,6 +94,7 @@ namespace config {
|
|||||||
("httpproxy.latency.min", value<std::string>()->default_value("0"), "HTTP proxy min latency for tunnels")
|
("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.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.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");
|
options_description socksproxy("SOCKS Proxy options");
|
||||||
|
@ -237,7 +237,15 @@ namespace proxy {
|
|||||||
LogPrint(eLogDebug, "HTTPProxy: requested: ", m_ClientRequest.uri);
|
LogPrint(eLogDebug, "HTTPProxy: requested: ", m_ClientRequest.uri);
|
||||||
m_RequestURL.parse(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);
|
i2p::client::context.GetAddressBook ().InsertAddress (m_RequestURL.host, b64);
|
||||||
LogPrint (eLogInfo, "HTTPProxy: added b64 from addresshelper for ", m_RequestURL.host);
|
LogPrint (eLogInfo, "HTTPProxy: added b64 from addresshelper for ", m_RequestURL.host);
|
||||||
std::string full_url = m_RequestURL.to_string();
|
std::string full_url = m_RequestURL.to_string();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user