diff --git a/CHANGELOG.md b/CHANGELOG.md index 822c9237ce0b..a3ed46b6feb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ Line wrap the file at 100 chars. Th ## [Unreleased] ### Added +- Add WireGuard over Shadowsocks obfuscation to the CLI. It can be enabled with + `mullvad obfuscation set mode shadowsocks`. + #### Windows - Add experimental support for Windows ARM64. diff --git a/mullvad-cli/src/cmds/obfuscation.rs b/mullvad-cli/src/cmds/obfuscation.rs index 91d3320bd791..be2cd7a4865c 100644 --- a/mullvad-cli/src/cmds/obfuscation.rs +++ b/mullvad-cli/src/cmds/obfuscation.rs @@ -3,7 +3,9 @@ use clap::Subcommand; use mullvad_management_interface::MullvadProxyClient; use mullvad_types::{ constraints::Constraint, - relay_constraints::{ObfuscationSettings, SelectedObfuscation, Udp2TcpObfuscationSettings}, + relay_constraints::{ + ObfuscationSettings, SelectedObfuscation, ShadowsocksSettings, Udp2TcpObfuscationSettings, + }, }; #[derive(Subcommand, Debug)] @@ -18,16 +20,22 @@ pub enum Obfuscation { #[derive(Subcommand, Debug, Clone)] pub enum SetCommands { - /// Specifies if obfuscation should be used with WireGuard connections. - /// And if so, what obfuscation protocol it should use. + /// Specify which obfuscation protocol to use, if any. Mode { mode: SelectedObfuscation }, - /// Specifies the config for the udp2tcp obfuscator. + /// Configure udp2tcp obfuscation. Udp2tcp { /// Port to use, or 'any' #[arg(long, short = 'p')] port: Constraint, }, + + /// Configure Shadowsocks obfuscation. + Shadowsocks { + /// Port to use, or 'any' + #[arg(long, short = 'p')] + port: Constraint, + }, } impl Obfuscation { @@ -41,6 +49,7 @@ impl Obfuscation { obfuscation_settings.selected_obfuscation ); println!("udp2tcp settings: {}", obfuscation_settings.udp2tcp); + println!("Shadowsocks settings: {}", obfuscation_settings.shadowsocks); Ok(()) } Obfuscation::Set(subcmd) => Self::set(subcmd).await, @@ -66,6 +75,13 @@ impl Obfuscation { }) .await?; } + SetCommands::Shadowsocks { port } => { + rpc.set_obfuscation_settings(ObfuscationSettings { + shadowsocks: ShadowsocksSettings { port }, + ..current_settings + }) + .await?; + } } println!("Updated obfuscation settings");