diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-11-03 15:15:30 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-11-16 17:19:49 +0100 |
| commit | 29d055a7ebf4c97148e9212c580d5ef5f1c24cb4 (patch) | |
| tree | d957ea77ea4194028be9dada175ce9fcfde1d1b6 /gui/src/main | |
| parent | f9bebec26836aacb0c043a7b86482f2ae9c61495 (diff) | |
| download | mullvadvpn-29d055a7ebf4c97148e9212c580d5ef5f1c24cb4.tar.xz mullvadvpn-29d055a7ebf4c97148e9212c580d5ef5f1c24cb4.zip | |
Add IPC and RPC calls for updating dns options
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 9 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 0252c22e13..c7f4ce8608 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -48,6 +48,7 @@ import { ProxySettings, VoucherResponse, TunnelProtocol, + IDnsOptions, } from '../shared/daemon-rpc-types'; import * as managementInterface from './management_interface/management_interface_grpc_pb'; @@ -452,6 +453,14 @@ export class DaemonRpc { }; } + public async setDnsOptions(dns: IDnsOptions): Promise<void> { + const dnsOptions = new grpcTypes.DnsOptions(); + dnsOptions.setCustom(dns.custom); + dnsOptions.setAddressesList(dns.addresses); + + await this.call<grpcTypes.DnsOptions, Empty>(this.client.setDnsOptions, dnsOptions); + } + public async verifyWireguardKey(): Promise<boolean> { const response = await this.callEmpty<BoolValue>(this.client.verifyWireguardKey); return response.getValue(); diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 9e7e9e931c..d780e8e128 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -15,6 +15,7 @@ import { DaemonEvent, IAccountData, IAppVersionInfo, + IDnsOptions, ILocation, IRelayList, ISettings, @@ -988,6 +989,9 @@ class ApplicationMain { IpcMainEventChannel.settings.handleUpdateBridgeSettings((bridgeSettings: BridgeSettings) => { return this.daemonRpc.setBridgeSettings(bridgeSettings); }); + IpcMainEventChannel.settings.handleDnsOptions((dns: IDnsOptions) => { + return this.daemonRpc.setDnsOptions(dns); + }); IpcMainEventChannel.autoStart.handleSet((autoStart: boolean) => { return this.setAutoStart(autoStart); }); |
