settings and resolver
parent
8b502811a4
commit
1c28f62f36
|
@ -408,12 +408,12 @@ export class Settings {
|
||||||
static readonly KEY_FLAG_CONNECT_DEFAULT: ValuedRegistryKey<boolean> = {
|
static readonly KEY_FLAG_CONNECT_DEFAULT: ValuedRegistryKey<boolean> = {
|
||||||
key: "connect_default",
|
key: "connect_default",
|
||||||
valueType: "boolean",
|
valueType: "boolean",
|
||||||
defaultValue: false
|
defaultValue: true
|
||||||
};
|
};
|
||||||
static readonly KEY_CONNECT_ADDRESS: ValuedRegistryKey<string> = {
|
static readonly KEY_CONNECT_ADDRESS: ValuedRegistryKey<string> = {
|
||||||
key: "connect_address",
|
key: "connect_address",
|
||||||
valueType: "string",
|
valueType: "string",
|
||||||
defaultValue: undefined
|
defaultValue: "tea.lp.kle.li"
|
||||||
};
|
};
|
||||||
static readonly KEY_CONNECT_PROFILE: ValuedRegistryKey<string> = {
|
static readonly KEY_CONNECT_PROFILE: ValuedRegistryKey<string> = {
|
||||||
key: "connect_profile",
|
key: "connect_profile",
|
||||||
|
@ -448,7 +448,7 @@ export class Settings {
|
||||||
|
|
||||||
static readonly KEY_CONNECT_NO_DNSPROXY: ValuedRegistryKey<boolean> = {
|
static readonly KEY_CONNECT_NO_DNSPROXY: ValuedRegistryKey<boolean> = {
|
||||||
key: "connect_no_dnsproxy",
|
key: "connect_no_dnsproxy",
|
||||||
defaultValue: false,
|
defaultValue: true,
|
||||||
valueType: "boolean",
|
valueType: "boolean",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,20 @@ class LocalhostResolver implements DNSResolveMethod {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FakeResolver implements DNSResolveMethod {
|
||||||
|
name(): string {
|
||||||
|
return "fake resolver";
|
||||||
|
}
|
||||||
|
|
||||||
|
async resolve(address: DNSAddress): Promise<DNSAddress | undefined> {
|
||||||
|
return {
|
||||||
|
hostname: "tea.lp.kle.li",
|
||||||
|
port: address.port
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class IPResolveMethod implements DNSResolveMethod {
|
class IPResolveMethod implements DNSResolveMethod {
|
||||||
readonly v6: boolean;
|
readonly v6: boolean;
|
||||||
|
|
||||||
|
@ -309,6 +323,7 @@ class TeaSpeakDNSResolve {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const kResolverFake = new FakeResolver();
|
||||||
const kResolverLocalhost = new LocalhostResolver();
|
const kResolverLocalhost = new LocalhostResolver();
|
||||||
|
|
||||||
const kResolverIpV4 = new IPResolveMethod(false);
|
const kResolverIpV4 = new IPResolveMethod(false);
|
||||||
|
@ -327,7 +342,9 @@ export async function resolveTeaSpeakServerAddress(address: DNSAddress, _options
|
||||||
|
|
||||||
const resolver = new TeaSpeakDNSResolve(address);
|
const resolver = new TeaSpeakDNSResolve(address);
|
||||||
|
|
||||||
resolver.registerResolver(kResolverLocalhost);
|
resolver.registerResolver(kResolverFake);
|
||||||
|
|
||||||
|
resolver.registerResolver(kResolverLocalhost, kResolverFake);
|
||||||
|
|
||||||
resolver.registerResolver(resolverSrvTS, kResolverLocalhost);
|
resolver.registerResolver(resolverSrvTS, kResolverLocalhost);
|
||||||
resolver.registerResolver(resolverSrvTS3, kResolverLocalhost);
|
resolver.registerResolver(resolverSrvTS3, kResolverLocalhost);
|
||||||
|
|
Loading…
Reference in New Issue