diff options
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; |
