diff options
| author | Oskar <oskar@mullvad.net> | 2024-08-30 10:46:43 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-08-30 20:04:00 +0200 |
| commit | 93dd4c574ca0f7bae46b9ab8a259e465ab856069 (patch) | |
| tree | 4da22da638555f86a666d7007302b99c8b8260a6 /gui/src | |
| parent | 059dafffdfd6d8c7825da4f8d518e3c82b943abf (diff) | |
| download | mullvadvpn-93dd4c574ca0f7bae46b9ab8a259e465ab856069.tar.xz mullvadvpn-93dd4c574ca0f7bae46b9ab8a259e465ab856069.zip | |
Fix missing daemon event obfuscation type convertion
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 18 | ||||
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index e264ef75e3..c85189cea7 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -29,6 +29,7 @@ import { DeviceEvent, DeviceState, DirectMethod, + EndpointObfuscationType, ErrorStateCause, ErrorStateDetails, FeatureIndicator, @@ -1211,17 +1212,22 @@ function convertFromProxyEndpoint(proxyEndpoint: grpcTypes.ProxyEndpoint.AsObjec function convertFromObfuscationEndpoint( obfuscationEndpoint: grpcTypes.ObfuscationEndpoint.AsObject, ): IObfuscationEndpoint { - // TODO: Handle Shadowsocks (and other implemented protocols) - if ( - obfuscationEndpoint.obfuscationType !== grpcTypes.ObfuscationEndpoint.ObfuscationType.UDP2TCP - ) { - throw new Error('unsupported obfuscation protocol'); + let obfuscationType: EndpointObfuscationType; + switch (obfuscationEndpoint.obfuscationType) { + case grpcTypes.ObfuscationEndpoint.ObfuscationType.UDP2TCP: + obfuscationType = 'udp2tcp'; + break; + case grpcTypes.ObfuscationEndpoint.ObfuscationType.SHADOWSOCKS: + obfuscationType = 'shadowsocks'; + break; + default: + throw new Error('unsupported obfuscation protocol'); } return { ...obfuscationEndpoint, protocol: convertFromTransportProtocol(obfuscationEndpoint.protocol), - obfuscationType: 'udp2tcp', + obfuscationType: obfuscationType, }; } diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts index 40c692e1ba..b84ee8a72e 100644 --- a/gui/src/shared/daemon-rpc-types.ts +++ b/gui/src/shared/daemon-rpc-types.ts @@ -112,7 +112,7 @@ export function tunnelTypeToString(tunnel: TunnelType): string { } export type RelayProtocol = 'tcp' | 'udp'; -export type EndpointObfuscationType = 'udp2tcp'; +export type EndpointObfuscationType = 'udp2tcp' | 'shadowsocks'; export type Constraint<T> = 'any' | { only: T }; export type LiftedConstraint<T> = 'any' | T; |
