feat: Allow direct control of IP family to be returned by DNS lookup

implements #306
This commit is contained in:
cetteup 2022-12-13 10:46:43 +01:00
parent 70ec2a45a7
commit 3c38fe48fe
4 changed files with 9 additions and 7 deletions

View file

@ -69,7 +69,7 @@ class Core extends EventEmitter {
async runOnce() {
const options = this.options;
if (('host' in options) && !('address' in options)) {
const resolved = await this.dnsResolver.resolve(options.host, this.srvRecord);
const resolved = await this.dnsResolver.resolve(options.host, options.ipFamily, this.srvRecord);
options.address = resolved.address;
if (resolved.port) options.port = resolved.port;
}