diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-08-16 09:14:56 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2024-08-16 09:14:56 +0200 |
| commit | fe705988688962c96401686cd3d1309c296eeae1 (patch) | |
| tree | 71fd3c6759e403d94550d99a216523d5bad4fd10 /gui | |
| parent | 532b8ade64f47be9d00655844f4b5fb9070f293e (diff) | |
| parent | 854c9babc336a01e4e49a75c67aaf81ba331540b (diff) | |
| download | mullvadvpn-fe705988688962c96401686cd3d1309c296eeae1.tar.xz mullvadvpn-fe705988688962c96401686cd3d1309c296eeae1.zip | |
Merge branch 'add-shadowsocks-obfuscation'
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 3461a85ac5..65e3c6b1c5 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -29,7 +29,6 @@ import { DeviceEvent, DeviceState, DirectMethod, - EndpointObfuscationType, ErrorState, ErrorStateCause, FirewallPolicyError, @@ -403,6 +402,8 @@ export class DaemonRpc { grpcObfuscationSettings.setUdp2tcp(grpcUdp2tcpSettings); } + grpcObfuscationSettings.setShadowsocks(new grpcTypes.ShadowsocksSettings()); + await this.call<grpcTypes.ObfuscationSettings, Empty>( this.client.setObfuscationSettings, grpcObfuscationSettings, @@ -1136,9 +1137,9 @@ function convertFromTunnelType(tunnelType: grpcTypes.TunnelType): TunnelType { } function convertFromProxyEndpoint(proxyEndpoint: grpcTypes.ProxyEndpoint.AsObject): IProxyEndpoint { - const proxyTypeMap: Record<grpcTypes.ProxyType, ProxyType> = { - [grpcTypes.ProxyType.CUSTOM]: 'custom', - [grpcTypes.ProxyType.SHADOWSOCKS]: 'shadowsocks', + const proxyTypeMap: Record<grpcTypes.ProxyEndpoint.ProxyType, ProxyType> = { + [grpcTypes.ProxyEndpoint.ProxyType.CUSTOM]: 'custom', + [grpcTypes.ProxyEndpoint.ProxyType.SHADOWSOCKS]: 'shadowsocks', }; return { @@ -1151,14 +1152,17 @@ function convertFromProxyEndpoint(proxyEndpoint: grpcTypes.ProxyEndpoint.AsObjec function convertFromObfuscationEndpoint( obfuscationEndpoint: grpcTypes.ObfuscationEndpoint.AsObject, ): IObfuscationEndpoint { - const obfuscationTypes: Record<grpcTypes.ObfuscationType, EndpointObfuscationType> = { - [grpcTypes.ObfuscationType.UDP2TCP]: 'udp2tcp', - }; + // TODO: Handle Shadowsocks (and other implemented protocols) + if ( + obfuscationEndpoint.obfuscationType !== grpcTypes.ObfuscationEndpoint.ObfuscationType.UDP2TCP + ) { + throw new Error('unsupported obfuscation protocol'); + } return { ...obfuscationEndpoint, protocol: convertFromTransportProtocol(obfuscationEndpoint.protocol), - obfuscationType: obfuscationTypes[obfuscationEndpoint.obfuscationType], + obfuscationType: 'udp2tcp', }; } |
