|
@@ -64,6 +64,9 @@ pub struct Settings {
|
|
|
pub allowed_transports: Vec<String>,
|
|
pub allowed_transports: Vec<String>,
|
|
|
/// Allow transport mixing (e.g. Tor would be allowed to connect to `tcp://`)
|
|
/// Allow transport mixing (e.g. Tor would be allowed to connect to `tcp://`)
|
|
|
pub transport_mixing: bool,
|
|
pub transport_mixing: bool,
|
|
|
|
|
+ /// Socks5 proxy to connect to when socks5 or socks5+tls are added to allowed transports
|
|
|
|
|
+ /// and transport mixing is enabled
|
|
|
|
|
+ pub socks5_proxy: Url,
|
|
|
/// Outbound connection slots number, this many connections will be
|
|
/// Outbound connection slots number, this many connections will be
|
|
|
/// attempted. (This does not include manual connections)
|
|
/// attempted. (This does not include manual connections)
|
|
|
pub outbound_connections: usize,
|
|
pub outbound_connections: usize,
|
|
@@ -124,6 +127,7 @@ impl Default for Settings {
|
|
|
app_version,
|
|
app_version,
|
|
|
allowed_transports: vec!["tcp+tls".to_string()],
|
|
allowed_transports: vec!["tcp+tls".to_string()],
|
|
|
transport_mixing: true,
|
|
transport_mixing: true,
|
|
|
|
|
+ socks5_proxy: Url::parse("socks5://127.0.0.1:9050").unwrap(),
|
|
|
outbound_connections: 8,
|
|
outbound_connections: 8,
|
|
|
inbound_connections: 8,
|
|
inbound_connections: 8,
|
|
|
outbound_connect_timeout: 15,
|
|
outbound_connect_timeout: 15,
|
|
@@ -225,6 +229,11 @@ pub struct SettingsOpt {
|
|
|
#[structopt(long)]
|
|
#[structopt(long)]
|
|
|
pub transport_mixing: Option<bool>,
|
|
pub transport_mixing: Option<bool>,
|
|
|
|
|
|
|
|
|
|
+ /// Socks5 proxy to connect to when socks5 or socks5+tls are added to allowed transports
|
|
|
|
|
+ /// and transport mixing is enabled
|
|
|
|
|
+ #[structopt(long)]
|
|
|
|
|
+ pub socks5_proxy: Option<Url>,
|
|
|
|
|
+
|
|
|
/// If this is true, strictly follow the gold_connect_count and
|
|
/// If this is true, strictly follow the gold_connect_count and
|
|
|
/// white_connect_percent settings. Otherwise, connect to greylist
|
|
/// white_connect_percent settings. Otherwise, connect to greylist
|
|
|
/// entries if we have no white or gold connections.
|
|
/// entries if we have no white or gold connections.
|
|
@@ -301,6 +310,7 @@ impl From<SettingsOpt> for Settings {
|
|
|
app_version: def.app_version,
|
|
app_version: def.app_version,
|
|
|
allowed_transports: opt.allowed_transports.unwrap_or(def.allowed_transports),
|
|
allowed_transports: opt.allowed_transports.unwrap_or(def.allowed_transports),
|
|
|
transport_mixing: opt.transport_mixing.unwrap_or(def.transport_mixing),
|
|
transport_mixing: opt.transport_mixing.unwrap_or(def.transport_mixing),
|
|
|
|
|
+ socks5_proxy: opt.socks5_proxy.unwrap_or(def.socks5_proxy),
|
|
|
outbound_connections: opt.outbound_connections.unwrap_or(def.outbound_connections),
|
|
outbound_connections: opt.outbound_connections.unwrap_or(def.outbound_connections),
|
|
|
inbound_connections: opt.inbound_connections.unwrap_or(def.inbound_connections),
|
|
inbound_connections: opt.inbound_connections.unwrap_or(def.inbound_connections),
|
|
|
outbound_connect_timeout: opt
|
|
outbound_connect_timeout: opt
|