diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-01-03 14:23:02 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-01-03 14:23:02 +0100 |
| commit | 5e72bac67addd36682443568de651fc05cd6e207 (patch) | |
| tree | 750ac3f0737f4580258c69540e491303ac619461 /gui/src/shared | |
| parent | f4cd4fc51955874f7e7ac13636b63ecfa8f9eaf3 (diff) | |
| parent | c7027fac2b5db7a2a19f1f79137b1a2d371335cb (diff) | |
| download | mullvadvpn-5e72bac67addd36682443568de651fc05cd6e207.tar.xz mullvadvpn-5e72bac67addd36682443568de651fc05cd6e207.zip | |
Merge branch 'add-wg-multihop'
Diffstat (limited to 'gui/src/shared')
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 9 | ||||
| -rw-r--r-- | gui/src/shared/relay-settings-builder.ts | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts index 300af97660..3f026b032c 100644 --- a/gui/src/shared/daemon-rpc-types.ts +++ b/gui/src/shared/daemon-rpc-types.ts @@ -14,6 +14,7 @@ export interface ILocation { mullvadExitIp: boolean; hostname?: string; bridgeHostname?: string; + entryHostname?: string; provider?: string; } @@ -88,6 +89,12 @@ export interface ITunnelEndpoint { protocol: RelayProtocol; tunnelType: TunnelType; proxy?: IProxyEndpoint; + entryEndpoint?: IEndpoint; +} + +export interface IEndpoint { + address: string; + transportProtocol: RelayProtocol; } export interface IProxyEndpoint { @@ -133,6 +140,8 @@ export interface IOpenVpnConstraints { export interface IWireguardConstraints { port: Constraint<number>; ipVersion: Constraint<IpVersion>; + useMultihop: boolean; + entryLocation: Constraint<RelayLocation>; } export type TunnelProtocol = 'wireguard' | 'openvpn'; diff --git a/gui/src/shared/relay-settings-builder.ts b/gui/src/shared/relay-settings-builder.ts index 418de10888..e4c11e5132 100644 --- a/gui/src/shared/relay-settings-builder.ts +++ b/gui/src/shared/relay-settings-builder.ts @@ -3,6 +3,7 @@ import { IOpenVpnConstraints, IpVersion, IWireguardConstraints, + RelayLocation, RelayProtocol, RelaySettingsNormalUpdate, RelaySettingsUpdate, @@ -23,6 +24,8 @@ interface IOpenVPNConfigurator { interface IWireguardConfigurator { port: IExactOrAny<number, IWireguardConfigurator>; ipVersion: IExactOrAny<IpVersion, IWireguardConfigurator>; + useMultihop: (value: boolean) => IWireguardConfigurator; + entryLocation: IExactOrAny<RelayLocation, IWireguardConfigurator>; } interface ITunnelProtocolConfigurator { @@ -137,6 +140,22 @@ class NormalRelaySettingsBuilder { any: () => apply('any'), }; }, + get useMultihop() { + return (useMultihop: boolean) => { + updateWireguard({ useMultihop }); + return this; + }; + }, + get entryLocation() { + const apply = (entryLocation: Constraint<RelayLocation> | undefined) => { + updateWireguard({ entryLocation }); + return this; + }; + return { + exact: (entryLocation: RelayLocation) => apply({ only: entryLocation }), + any: () => apply('any'), + }; + }, }; configurator(wireguardBuilder); return this; |
