summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2024-08-30 10:46:43 +0200
committerOskar <oskar@mullvad.net>2024-08-30 20:04:00 +0200
commit93dd4c574ca0f7bae46b9ab8a259e465ab856069 (patch)
tree4da22da638555f86a666d7007302b99c8b8260a6 /gui/src/main
parent059dafffdfd6d8c7825da4f8d518e3c82b943abf (diff)
downloadmullvadvpn-93dd4c574ca0f7bae46b9ab8a259e465ab856069.tar.xz
mullvadvpn-93dd4c574ca0f7bae46b9ab8a259e465ab856069.zip
Fix missing daemon event obfuscation type convertion
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts18
1 files changed, 12 insertions, 6 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,
};
}