diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 1adfe4c2ae9b..65e3c6b1c591 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -1137,9 +1137,9 @@ function convertFromTunnelType(tunnelType: grpcTypes.TunnelType): TunnelType { } function convertFromProxyEndpoint(proxyEndpoint: grpcTypes.ProxyEndpoint.AsObject): IProxyEndpoint { - const proxyTypeMap: Record = { - [grpcTypes.ProxyType.CUSTOM]: 'custom', - [grpcTypes.ProxyType.SHADOWSOCKS]: 'shadowsocks', + const proxyTypeMap: Record = { + [grpcTypes.ProxyEndpoint.ProxyType.CUSTOM]: 'custom', + [grpcTypes.ProxyEndpoint.ProxyType.SHADOWSOCKS]: 'shadowsocks', }; return { diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 468f4fca38aa..1a456a48bbde 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -2931,6 +2931,13 @@ impl Daemon { .as_ref() .filter(|obfuscation| obfuscation.obfuscation_type == ObfuscationType::Udp2Tcp) .is_some(); + let shadowsocks = endpoint + .obfuscation + .as_ref() + .filter(|obfuscation| { + obfuscation.obfuscation_type == ObfuscationType::Shadowsocks + }) + .is_some(); let mtu = settings.tunnel_options.wireguard.mtu.is_some(); @@ -2941,6 +2948,7 @@ impl Daemon { (quantum_resistant, FeatureIndicator::QuantumResistance), (multihop, FeatureIndicator::Multihop), (udp_tcp, FeatureIndicator::Udp2Tcp), + (shadowsocks, FeatureIndicator::Shadowsocks), (mtu, FeatureIndicator::CustomMtu), #[cfg(daita)] (daita, FeatureIndicator::Daita), diff --git a/mullvad-management-interface/proto/management_interface.proto b/mullvad-management-interface/proto/management_interface.proto index 12a0e2590042..e705c6378898 100644 --- a/mullvad-management-interface/proto/management_interface.proto +++ b/mullvad-management-interface/proto/management_interface.proto @@ -254,13 +254,14 @@ enum FeatureIndicator { SPLIT_TUNNELING = 3; LOCKDOWN_MODE = 4; UDP_2_TCP = 5; - LAN_SHARING = 6; - DNS_CONTENT_BLOCKERS = 7; - CUSTOM_DNS = 8; - SERVER_IP_OVERRIDE = 9; - CUSTOM_MTU = 10; - CUSTOM_MSS_FIX = 11; - DAITA = 12; + SHADOWSOCKS = 6; + LAN_SHARING = 7; + DNS_CONTENT_BLOCKERS = 8; + CUSTOM_DNS = 9; + SERVER_IP_OVERRIDE = 10; + CUSTOM_MTU = 11; + CUSTOM_MSS_FIX = 12; + DAITA = 13; } message ObfuscationEndpoint { @@ -275,17 +276,17 @@ message ObfuscationEndpoint { ObfuscationType obfuscation_type = 4; } -enum ProxyType { - SHADOWSOCKS = 0; - CUSTOM = 1; -} - message Endpoint { string address = 1; TransportProtocol protocol = 2; } message ProxyEndpoint { + enum ProxyType { + SHADOWSOCKS = 0; + CUSTOM = 1; + } + string address = 1; TransportProtocol protocol = 2; ProxyType proxy_type = 3; diff --git a/mullvad-management-interface/src/types/conversions/features.rs b/mullvad-management-interface/src/types/conversions/features.rs index ae04fc9099e1..d21441a610b4 100644 --- a/mullvad-management-interface/src/types/conversions/features.rs +++ b/mullvad-management-interface/src/types/conversions/features.rs @@ -10,6 +10,7 @@ impl From for proto::FeatureIndicator mullvad_types::features::FeatureIndicator::SplitTunneling => SplitTunneling, mullvad_types::features::FeatureIndicator::LockdownMode => LockdownMode, mullvad_types::features::FeatureIndicator::Udp2Tcp => Udp2Tcp, + mullvad_types::features::FeatureIndicator::Shadowsocks => Shadowsocks, mullvad_types::features::FeatureIndicator::LanSharing => LanSharing, mullvad_types::features::FeatureIndicator::DnsContentBlockers => DnsContentBlockers, mullvad_types::features::FeatureIndicator::CustomDns => CustomDns, @@ -30,6 +31,7 @@ impl From for mullvad_types::features::FeatureIndicator proto::FeatureIndicator::SplitTunneling => Self::SplitTunneling, proto::FeatureIndicator::LockdownMode => Self::LockdownMode, proto::FeatureIndicator::Udp2Tcp => Self::Udp2Tcp, + proto::FeatureIndicator::Shadowsocks => Self::Shadowsocks, proto::FeatureIndicator::LanSharing => Self::LanSharing, proto::FeatureIndicator::DnsContentBlockers => Self::DnsContentBlockers, proto::FeatureIndicator::CustomDns => Self::CustomDns, diff --git a/mullvad-management-interface/src/types/conversions/net.rs b/mullvad-management-interface/src/types/conversions/net.rs index 93af637e37ac..249ca5f40601 100644 --- a/mullvad-management-interface/src/types/conversions/net.rs +++ b/mullvad-management-interface/src/types/conversions/net.rs @@ -17,8 +17,12 @@ impl From for proto::TunnelEndpoint { address: proxy_ep.endpoint.address.to_string(), protocol: i32::from(proto::TransportProtocol::from(proxy_ep.endpoint.protocol)), proxy_type: match proxy_ep.proxy_type { - net::proxy::ProxyType::Shadowsocks => i32::from(proto::ProxyType::Shadowsocks), - net::proxy::ProxyType::Custom => i32::from(proto::ProxyType::Custom), + net::proxy::ProxyType::Shadowsocks => { + i32::from(proto::proxy_endpoint::ProxyType::Shadowsocks) + } + net::proxy::ProxyType::Custom => { + i32::from(proto::proxy_endpoint::ProxyType::Custom) + } }, }), obfuscation: endpoint.obfuscation.map(|obfuscation_endpoint| { @@ -77,11 +81,15 @@ impl TryFrom for talpid_types::net::TunnelEndpoint { )?, protocol: try_transport_protocol_from_i32(proxy_ep.protocol)?, }, - proxy_type: match proto::ProxyType::try_from(proxy_ep.proxy_type) { - Ok(proto::ProxyType::Shadowsocks) => { + proxy_type: match proto::proxy_endpoint::ProxyType::try_from( + proxy_ep.proxy_type, + ) { + Ok(proto::proxy_endpoint::ProxyType::Shadowsocks) => { talpid_net::proxy::ProxyType::Shadowsocks } - Ok(proto::ProxyType::Custom) => talpid_net::proxy::ProxyType::Custom, + Ok(proto::proxy_endpoint::ProxyType::Custom) => { + talpid_net::proxy::ProxyType::Custom + } Err(_) => { return Err(FromProtobufTypeError::InvalidArgument( "unknown proxy type", diff --git a/mullvad-types/src/features.rs b/mullvad-types/src/features.rs index 9a6b7c7e6466..30455bd0bc90 100644 --- a/mullvad-types/src/features.rs +++ b/mullvad-types/src/features.rs @@ -31,6 +31,7 @@ pub enum FeatureIndicator { SplitTunneling, LockdownMode, Udp2Tcp, + Shadowsocks, LanSharing, DnsContentBlockers, CustomDns, @@ -49,6 +50,7 @@ impl std::fmt::Display for FeatureIndicator { FeatureIndicator::SplitTunneling => "Split Tunneling", FeatureIndicator::LockdownMode => "Lockdown Mode", FeatureIndicator::Udp2Tcp => "Udp2Tcp", + FeatureIndicator::Shadowsocks => "Shadowsocks", FeatureIndicator::LanSharing => "LAN Sharing", FeatureIndicator::DnsContentBlockers => "Dns Content Blocker", FeatureIndicator::CustomDns => "Custom Dns",