Fix DNS resolution

not sure why this works but resolve4 doesn't
This commit is contained in:
CakeLancelot 2023-09-14 06:44:11 -05:00
parent dabb8bf484
commit ab5de9488d

View File

@ -280,10 +280,10 @@ function setGameInfo(serverUUID) {
// DNS resolution. there is no synchronous version for some stupid reason // DNS resolution. there is no synchronous version for some stupid reason
if (!address.match(/^[0-9.]+$/)) if (!address.match(/^[0-9.]+$/))
dns.resolve4(address, function (err, res) { dns.lookup(address, family=4, function (err, resolvedAddress) {
if (!err) { if (!err) {
console.log("Resolved " + address + " to " + res[0]); console.log("Resolved " + address + " to " + resolvedAddress);
address = res[0]; address = resolvedAddress;
} else { } else {
console.log("Err: " + err.code); console.log("Err: " + err.code);
} }