Browse Source

lenght and number of tunnels for HTTP Proxy

pull/697/merge
orignal 8 years ago
parent
commit
11b90d2113
  1. 14
      ClientContext.cpp
  2. 4
      Config.cpp
  3. 10
      docs/configuration.md

14
ClientContext.cpp

@ -53,7 +53,19 @@ namespace client
{ {
i2p::data::PrivateKeys keys; i2p::data::PrivateKeys keys;
if(LoadPrivateKeys (keys, httpProxyKeys)) if(LoadPrivateKeys (keys, httpProxyKeys))
localDestination = CreateNewLocalDestination (keys, false); {
std::map<std::string, std::string> 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, &params);
}
else else
LogPrint(eLogError, "Clients: failed to load HTTP Proxy key"); LogPrint(eLogError, "Clients: failed to load HTTP Proxy key");
} }

4
Config.cpp

@ -81,6 +81,10 @@ namespace config {
("httpproxy.address", value<std::string>()->default_value("127.0.0.1"), "HTTP Proxy listen address") ("httpproxy.address", value<std::string>()->default_value("127.0.0.1"), "HTTP Proxy listen address")
("httpproxy.port", value<uint16_t>()->default_value(4444), "HTTP Proxy listen port") ("httpproxy.port", value<uint16_t>()->default_value(4444), "HTTP Proxy listen port")
("httpproxy.keys", value<std::string>()->default_value(""), "File to persist HTTP Proxy keys") ("httpproxy.keys", value<std::string>()->default_value(""), "File to persist HTTP Proxy keys")
("httpproxy.inbound.length", value<std::string>()->default_value("3"), "HTTP proxy inbound tunnel length")
("httpproxy.outbound.length", value<std::string>()->default_value("3"), "HTTP proxy outbound tunnel length")
("httpproxy.inbound.quantity", value<std::string>()->default_value("5"), "HTTP proxy inbound tunnels quantity")
("httpproxy.outbound.quantity", value<std::string>()->default_value("5"), "HTTP proxy outbound tunnels quantity")
; ;
options_description socksproxy("SOCKS Proxy options"); options_description socksproxy("SOCKS Proxy options");

10
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.user= - Username for basic auth (default: i2pd)
* --http.pass= - Password for basic auth (default: random, see logs) * --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.address= - The address to listen on (HTTP Proxy)
* --httpproxy.port= - The port to listen on (HTTP Proxy) 4444 by default * --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.keys= - optional keys file for HTTP proxy local destination
* --httpproxy.enabled= - If HTTP proxy is enabled. true by default * --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.address= - The address to listen on (SOCKS Proxy)
* --socksproxy.port= - The port to listen on (SOCKS Proxy). 4447 by default * --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.enabled= - If SOCKS proxy is enabled. true by default
* --socksproxy.outproxy= - Address of outproxy. requests outside i2p will go there * --socksproxy.outproxy= - Address of outproxy. requests outside i2p will go there
* --socksproxy.outproxyport= - Outproxy remote port * --socksproxy.outproxyport= - Outproxy remote port

Loading…
Cancel
Save