Merge pull request #307 from cetteup/feature/dns-ip-family

Allow direct control of IP family to be returned by DNS lookup
This commit is contained in:
Michael Morrison 2023-01-10 13:38:20 -06:00 committed by GitHub
commit 57a6a2fadd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 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;
}