diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-07-15 13:50:09 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-08-19 12:30:10 +0200 |
| commit | c80a11ac4374dfba4577d064db728a1c7df5e9cf (patch) | |
| tree | 58d795a0d19f23a969b00c197a064a9347dde96a /mullvad-cli/src | |
| parent | 4be1b0d4a71cfa18a783dd4d35d58ab2cc27dfcc (diff) | |
| download | mullvadvpn-c80a11ac4374dfba4577d064db728a1c7df5e9cf.tar.xz mullvadvpn-c80a11ac4374dfba4577d064db728a1c7df5e9cf.zip | |
Add transport protocol constraint for WireGuard
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 245eda9e91..d119617802 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -167,6 +167,14 @@ impl Command for Relay { .required(true) ) .arg( + clap::Arg::with_name("transport protocol") + .help("Transport protocol. If TCP is selected, traffic is \ + sent over TCP using a udp-over-tcp proxy") + .long("protocol") + .default_value("any") + .possible_values(&["any", "udp", "tcp"]), + ) + .arg( clap::Arg::with_name("ip version") .long("ipv") .default_value("any") @@ -528,6 +536,7 @@ impl Relay { async fn set_wireguard_constraints(&self, matches: &clap::ArgMatches<'_>) -> Result<()> { let port = parse_port_constraint(matches.value_of("port").unwrap())?; + let protocol = parse_protocol_constraint(matches.value_of("transport protocol").unwrap()); let ip_version = parse_ip_version_constraint(matches.value_of("ip version").unwrap()); let entry_location = parse_entry_location_constraint(matches.values_of("entry location").unwrap()); @@ -537,6 +546,11 @@ impl Relay { NormalRelaySettingsUpdate { wireguard_constraints: Some(WireguardConstraints { port: port.unwrap_or(0) as u32, + protocol: protocol + .option() + .map(|protocol| TransportProtocolConstraint { + protocol: protocol as i32, + }), ip_version: ip_version.option().map(|protocol| IpVersionConstraint { protocol: protocol as i32, }), |
