summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2024-05-30 17:20:46 +0200
committerDavid Lönnhager <david.l@mullvad.net>2024-08-16 09:13:30 +0200
commit0945cdb9ac304ff4c46144e290198cdae810e17d (patch)
tree983464d7ff281a8af9d9cf519b40cd6db40e0d39 /gui
parent39c0a267382e51831652ff0966df8fb180b989d8 (diff)
downloadmullvadvpn-0945cdb9ac304ff4c46144e290198cdae810e17d.tar.xz
mullvadvpn-0945cdb9ac304ff4c46144e290198cdae810e17d.zip
Add Shadowsocks obfuscation support to mullvad-daemon
Diffstat (limited to 'gui')
-rw-r--r--gui/src/main/daemon-rpc.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 3461a85ac5..1adfe4c2ae 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,
@@ -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',
};
}