diff options
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 16 | ||||
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 20 |
2 files changed, 35 insertions, 1 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 73c23b7158..f3e4d5a144 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -136,6 +136,20 @@ const relayListSchema = partialObject({ ipv4_addr_in: string, include_in_country: boolean, weight: number, + tunnels: partialObject({ + openvpn: arrayOf( + partialObject({ + port: number, + protocol: string, + }), + ), + wireguard: arrayOf( + partialObject({ + port_ranges: arrayOf(arrayOf(number)), + public_key: string, + }), + ), + }), }), ), }), @@ -343,7 +357,7 @@ export class DaemonRpc { try { return camelCaseObjectKeys(validate(relayListSchema, response)) as IRelayList; } catch (error) { - throw new ResponseParseError('Invalid response from get_relay_locations', error); + throw new ResponseParseError(`Invalid response from get_relay_locations: ${error}`, error); } } diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts index a2cd296c0c..4582a66549 100644 --- a/gui/src/shared/daemon-rpc-types.ts +++ b/gui/src/shared/daemon-rpc-types.ts @@ -154,6 +154,26 @@ export interface IRelayListHostname { ipv4AddrIn: string; includeInCountry: boolean; weight: number; + tunnels: IRelayTunnels; +} + +export interface IRelayTunnels { + openvpn: IOpenVpnTunnelData[]; + wireguard: IWireguardTunnelData[]; +} + +export interface IOpenVpnTunnelData { + port: number; + protocol: RelayProtocol; +} + +export interface IWireguardTunnelData { + // Port ranges are an array of pairs, such as [[53,53], [10_000, 60_000]], + // which in this case translates that the specific tunnel can be connected on + // port 53 and ports 10'000 through 60'000. + portRanges: Array<[number, number]>; + // Public key of the tunnel. + publicKey: string; } export interface ITunnelOptions { |
