summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-04-28 10:56:25 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-04-28 10:57:42 +0200
commit05ed04ec3ddc6d7f5d74397d7956bee36df70524 (patch)
treec3b8aee14c79ef60428293b5e2fd75b9d180b5cf /gui/src/renderer
parentfa4876768cd889b4a7b951d3be607f87b65323d1 (diff)
downloadmullvadvpn-05ed04ec3ddc6d7f5d74397d7956bee36df70524.tar.xz
mullvadvpn-05ed04ec3ddc6d7f5d74397d7956bee36df70524.zip
Show obfuscation endpoint as in-data
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/components/ConnectionPanel.tsx14
-rw-r--r--gui/src/renderer/containers/ConnectionPanelContainer.tsx22
2 files changed, 33 insertions, 3 deletions
diff --git a/gui/src/renderer/components/ConnectionPanel.tsx b/gui/src/renderer/components/ConnectionPanel.tsx
index 060802a1d9..7f4c28286b 100644
--- a/gui/src/renderer/components/ConnectionPanel.tsx
+++ b/gui/src/renderer/components/ConnectionPanel.tsx
@@ -4,6 +4,7 @@ import styled from 'styled-components';
import { colors } from '../../config.json';
import {
+ ObfuscationType,
ProxyType,
proxyTypeToString,
RelayProtocol,
@@ -29,6 +30,10 @@ export interface IBridgeData extends IEndpoint {
bridgeType: ProxyType;
}
+export interface IObfuscationData extends IEndpoint {
+ obfuscationType: ObfuscationType;
+}
+
export interface IOutAddress {
ipv4?: string;
ipv6?: string;
@@ -43,6 +48,7 @@ interface IProps {
entryLocationInAddress?: IInAddress;
bridgeInfo?: IBridgeData;
outAddress?: IOutAddress;
+ obfuscationEndpoint?: IObfuscationData;
onToggle: () => void;
className?: string;
}
@@ -126,10 +132,12 @@ export default class ConnectionPanel extends React.Component<IProps> {
);
}
- private getEntryPoint() {
- const { inAddress, entryLocationInAddress, bridgeInfo } = this.props;
+ private getEntryPoint(): IEndpoint | undefined {
+ const { obfuscationEndpoint, inAddress, entryLocationInAddress, bridgeInfo } = this.props;
- if (entryLocationInAddress && inAddress) {
+ if (obfuscationEndpoint) {
+ return obfuscationEndpoint;
+ } else if (entryLocationInAddress && inAddress) {
return entryLocationInAddress;
} else if (bridgeInfo && inAddress) {
return bridgeInfo;
diff --git a/gui/src/renderer/containers/ConnectionPanelContainer.tsx b/gui/src/renderer/containers/ConnectionPanelContainer.tsx
index f55fa8cacd..5311f1a8e4 100644
--- a/gui/src/renderer/containers/ConnectionPanelContainer.tsx
+++ b/gui/src/renderer/containers/ConnectionPanelContainer.tsx
@@ -5,6 +5,7 @@ import { ITunnelEndpoint, parseSocketAddress } from '../../shared/daemon-rpc-typ
import ConnectionPanel, {
IBridgeData,
IInAddress,
+ IObfuscationData,
IOutAddress,
} from '../components/ConnectionPanel';
import { IReduxState, ReduxDispatch } from '../redux/store';
@@ -50,6 +51,21 @@ function tunnelEndpointToBridgeData(endpoint: ITunnelEndpoint): IBridgeData | un
};
}
+function tunnelEndpointToObfuscationEndpoint(
+ endpoint: ITunnelEndpoint,
+): IObfuscationData | undefined {
+ if (!endpoint.obfuscationEndpoint) {
+ return undefined;
+ }
+
+ return {
+ ip: endpoint.obfuscationEndpoint.address,
+ port: endpoint.obfuscationEndpoint.port,
+ protocol: endpoint.obfuscationEndpoint.protocol,
+ obfuscationType: endpoint.obfuscationEndpoint.obfuscationType,
+ };
+}
+
const mapStateToProps = (state: IReduxState) => {
const status = state.connection.status;
@@ -73,6 +89,11 @@ const mapStateToProps = (state: IReduxState) => {
? tunnelEndpointToBridgeData(status.details.endpoint)
: undefined;
+ const obfuscationEndpoint: IObfuscationData | undefined =
+ (status.state === 'connecting' || status.state === 'connected') && status.details
+ ? tunnelEndpointToObfuscationEndpoint(status.details.endpoint)
+ : undefined;
+
return {
isOpen: state.userInterface.connectionPanelVisible,
hostname: state.connection.hostname,
@@ -82,6 +103,7 @@ const mapStateToProps = (state: IReduxState) => {
entryLocationInAddress,
bridgeInfo,
outAddress,
+ obfuscationEndpoint,
};
};