diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-08-26 10:18:57 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2024-08-26 10:18:57 +0200 |
| commit | b235a4d30c64fa2101e73569843b4cabf615fb88 (patch) | |
| tree | 6ce786b4a72db0c74152afa7de8192e9da652dca | |
| parent | 423bd573856d2e3d98bc7663ad09304d9439642b (diff) | |
| parent | 7a77d261cabc2515da0f748d8b57a36f37f68a60 (diff) | |
| download | mullvadvpn-b235a4d30c64fa2101e73569843b4cabf615fb88.tar.xz mullvadvpn-b235a4d30c64fa2101e73569843b4cabf615fb88.zip | |
Merge branch 'add-shadowsocks-obfuscation-cli'
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/obfuscation.rs | 24 |
2 files changed, 23 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 822c9237ce..a3ed46b6fe 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 91d3320bd7..be2cd7a486 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<u16>, }, + + /// Configure Shadowsocks obfuscation. + Shadowsocks { + /// Port to use, or 'any' + #[arg(long, short = 'p')] + port: Constraint<u16>, + }, } 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"); |
