diff --git a/ClientContext.cpp b/ClientContext.cpp index 215768c2..a50f0e45 100644 --- a/ClientContext.cpp +++ b/ClientContext.cpp @@ -53,7 +53,19 @@ namespace client { i2p::data::PrivateKeys keys; if(LoadPrivateKeys (keys, httpProxyKeys)) - localDestination = CreateNewLocalDestination (keys, false); + { + std::map params; + std::string value; + if (i2p::config::GetOption("httpproxy.inbound.length", value)) + params["inbound.length"] = value; + if (i2p::config::GetOption("httpproxy.inbound.quantity", value)) + params["inbound.quantity"] = value; + if (i2p::config::GetOption("httpproxy.outbound.length", value)) + params["outbound.length"] = value; + if (i2p::config::GetOption("httpproxy.outbound.quantity", value)) + params["outbound.quantity"] = value; + localDestination = CreateNewLocalDestination (keys, false, ¶ms); + } else LogPrint(eLogError, "Clients: failed to load HTTP Proxy key"); } diff --git a/Config.cpp b/Config.cpp index e72749bc..ba7d0f23 100644 --- a/Config.cpp +++ b/Config.cpp @@ -81,6 +81,10 @@ namespace config { ("httpproxy.address", value()->default_value("127.0.0.1"), "HTTP Proxy listen address") ("httpproxy.port", value()->default_value(4444), "HTTP Proxy listen port") ("httpproxy.keys", value()->default_value(""), "File to persist HTTP Proxy keys") + ("httpproxy.inbound.length", value()->default_value("3"), "HTTP proxy inbound tunnel length") + ("httpproxy.outbound.length", value()->default_value("3"), "HTTP proxy outbound tunnel length") + ("httpproxy.inbound.quantity", value()->default_value("5"), "HTTP proxy inbound tunnels quantity") + ("httpproxy.outbound.quantity", value()->default_value("5"), "HTTP proxy outbound tunnels quantity") ; options_description socksproxy("SOCKS Proxy options"); diff --git a/docs/configuration.md b/docs/configuration.md index 49d8c98d..4b73dd08 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -41,14 +41,18 @@ All options below still possible in cmdline, but better write it in config file: * --http.user= - Username for basic auth (default: i2pd) * --http.pass= - Password for basic auth (default: random, see logs) +* --httpproxy.enabled= - If HTTP proxy is enabled. true by default * --httpproxy.address= - The address to listen on (HTTP Proxy) * --httpproxy.port= - The port to listen on (HTTP Proxy) 4444 by default -* --httpproxy.keys= - optional keys file for proxy local destination (both HTTP and SOCKS) -* --httpproxy.enabled= - If HTTP proxy is enabled. true by default +* --httpproxy.keys= - optional keys file for HTTP proxy local destination +* --httpproxy.inbound.length= - Inbound tunnels length if keys is set. 3 by default +* --httpproxy.inbound.quantity= - Inbound tunnels quantity if keys is set. 5 by default +* --httpproxy.outbound.length= - Outbound tunnels length if keys is set. 3 by default +* --httpproxy.outbound.quantity= - Outbound tunnels quantity if keys is set. 5 by default * --socksproxy.address= - The address to listen on (SOCKS Proxy) * --socksproxy.port= - The port to listen on (SOCKS Proxy). 4447 by default -* --socksproxy.keys= - optional keys file for proxy local destination (both HTTP and SOCKS) +* --socksproxy.keys= - optional keys file for SOCKS proxy local destination * --socksproxy.enabled= - If SOCKS proxy is enabled. true by default * --socksproxy.outproxy= - Address of outproxy. requests outside i2p will go there * --socksproxy.outproxyport= - Outproxy remote port