summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts52
-rw-r--r--gui/src/main/tunnel-state.ts2
2 files changed, 51 insertions, 3 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 65e3c6b1c5..f328329d81 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -29,8 +29,9 @@ import {
DeviceEvent,
DeviceState,
DirectMethod,
- ErrorState,
ErrorStateCause,
+ ErrorStateDetails,
+ FeatureIndicator,
FirewallPolicyError,
FirewallPolicyErrorType,
IAppVersionInfo,
@@ -980,6 +981,9 @@ function convertFromTunnelState(tunnelState: grpcTypes.TunnelState): TunnelState
details:
tunnelStateObject.connecting?.relayInfo &&
convertFromTunnelStateRelayInfo(tunnelStateObject.connecting.relayInfo),
+ featureIndicators: convertFromFeatureIndicators(
+ tunnelStateObject.connecting?.featureIndicators?.activeFeaturesList,
+ ),
};
case grpcTypes.TunnelState.StateCase.CONNECTED: {
const relayInfo =
@@ -989,13 +993,16 @@ function convertFromTunnelState(tunnelState: grpcTypes.TunnelState): TunnelState
relayInfo && {
state: 'connected',
details: relayInfo,
+ featureIndicators: convertFromFeatureIndicators(
+ tunnelStateObject.connected?.featureIndicators?.activeFeaturesList,
+ ),
}
);
}
}
}
-function convertFromTunnelStateError(state: grpcTypes.ErrorState.AsObject): ErrorState {
+function convertFromTunnelStateError(state: grpcTypes.ErrorState.AsObject): ErrorStateDetails {
const baseError = {
blockingError: state.blockingError && convertFromBlockingError(state.blockingError),
};
@@ -1127,6 +1134,47 @@ function convertFromTunnelStateRelayInfo(
return undefined;
}
+function convertFromFeatureIndicators(
+ featureIndicators?: Array<grpcTypes.FeatureIndicator>,
+): Array<FeatureIndicator> | undefined {
+ return featureIndicators?.map(convertFromFeatureIndicator);
+}
+
+function convertFromFeatureIndicator(
+ featureIndicator: grpcTypes.FeatureIndicator,
+): FeatureIndicator {
+ switch (featureIndicator) {
+ case grpcTypes.FeatureIndicator.QUANTUM_RESISTANCE:
+ return FeatureIndicator.quantumResistance;
+ case grpcTypes.FeatureIndicator.MULTIHOP:
+ return FeatureIndicator.multihop;
+ case grpcTypes.FeatureIndicator.BRIDGE_MODE:
+ return FeatureIndicator.bridgeMode;
+ case grpcTypes.FeatureIndicator.SPLIT_TUNNELING:
+ return FeatureIndicator.splitTunneling;
+ case grpcTypes.FeatureIndicator.LOCKDOWN_MODE:
+ return FeatureIndicator.lockdownMode;
+ case grpcTypes.FeatureIndicator.UDP_2_TCP:
+ return FeatureIndicator.udp2tcp;
+ case grpcTypes.FeatureIndicator.LAN_SHARING:
+ return FeatureIndicator.lanSharing;
+ case grpcTypes.FeatureIndicator.DNS_CONTENT_BLOCKERS:
+ return FeatureIndicator.dnsContentBlockers;
+ case grpcTypes.FeatureIndicator.CUSTOM_DNS:
+ return FeatureIndicator.customDns;
+ case grpcTypes.FeatureIndicator.SERVER_IP_OVERRIDE:
+ return FeatureIndicator.serverIpOverride;
+ case grpcTypes.FeatureIndicator.CUSTOM_MTU:
+ return FeatureIndicator.customMtu;
+ case grpcTypes.FeatureIndicator.CUSTOM_MSS_FIX:
+ return FeatureIndicator.customMssFix;
+ case grpcTypes.FeatureIndicator.DAITA:
+ return FeatureIndicator.daita;
+ case grpcTypes.FeatureIndicator.SHADOWSOCKS:
+ return FeatureIndicator.shadowsocks;
+ }
+}
+
function convertFromTunnelType(tunnelType: grpcTypes.TunnelType): TunnelType {
const tunnelTypeMap: Record<grpcTypes.TunnelType, TunnelType> = {
[grpcTypes.TunnelType.WIREGUARD]: 'wireguard',
diff --git a/gui/src/main/tunnel-state.ts b/gui/src/main/tunnel-state.ts
index 297a7e481e..43ebe97ad6 100644
--- a/gui/src/main/tunnel-state.ts
+++ b/gui/src/main/tunnel-state.ts
@@ -46,7 +46,7 @@ export default class TunnelStateHandler {
this.setTunnelState(
state === 'disconnecting'
? { state, details: 'nothing' as const, location: this.lastKnownDisconnectedLocation }
- : { state },
+ : { state, featureIndicators: undefined },
);
this.tunnelStateFallbackScheduler.schedule(() => {