summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'mullvad-cli/src')
-rw-r--r--mullvad-cli/src/cmds/relay.rs27
1 files changed, 6 insertions, 21 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs
index 8cb9fa111b..c11ee82158 100644
--- a/mullvad-cli/src/cmds/relay.rs
+++ b/mullvad-cli/src/cmds/relay.rs
@@ -61,14 +61,6 @@ impl Command for Relay {
.multiple_values(true),
)
.arg(
- clap::Arg::new("protocol")
- .help("Transport protocol. If TCP is selected, traffic is \
- sent over TCP using a udp-over-tcp proxy")
- .long("protocol")
- .default_value("udp")
- .possible_values(&["udp", "tcp"]),
- )
- .arg(
clap::Arg::new("v6-gateway")
.help("IPv6 gateway address")
.long("v6-gateway")
@@ -164,14 +156,6 @@ impl Command for Relay {
.takes_value(true),
)
.arg(
- clap::Arg::new("transport protocol")
- .help("Transport protocol. If TCP is selected, traffic is \
- sent over TCP using a udp-over-tcp proxy")
- .long("protocol")
- .possible_values(&["any", "udp", "tcp"])
- .takes_value(true),
- )
- .arg(
clap::Arg::new("ip version")
.long("ipv")
.possible_values(&["any", "4", "6"])
@@ -310,8 +294,6 @@ impl Relay {
_ => e.exit(),
},
};
- let protocol: String = matches.value_of_t_or_exit("protocol");
- let protocol = Self::validate_transport_protocol(&protocol);
let mut private_key_str = String::new();
println!("Reading private key from standard input");
let _ = io::stdin().lock().read_line(&mut private_key_str);
@@ -341,7 +323,6 @@ impl Relay {
.collect(),
endpoint: SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), port)
.to_string(),
- protocol: protocol as i32,
}),
ipv4_gateway: ipv4_gateway.to_string(),
ipv6_gateway: ipv6_gateway
@@ -547,8 +528,12 @@ impl Relay {
let mut rpc = new_rpc_client().await?;
let mut wireguard_constraints = self.get_wireguard_constraints(&mut rpc).await?;
- wireguard_constraints.port =
- parse_transport_port(matches, &mut wireguard_constraints.port)?;
+ if let Some(port) = matches.value_of("port") {
+ wireguard_constraints.port = match parse_port_constraint(port)? {
+ Constraint::Any => 0,
+ Constraint::Only(specific_port) => u32::from(specific_port),
+ }
+ }
if let Some(ipv) = matches.value_of("ip version") {
wireguard_constraints.ip_version =