Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force IPv4 name resolution to have priority #4019

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/node_modules/node-red/lib/red.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ var api = require("@node-red/editor-api");
var server = null;
var apiEnabled = false;

const NODE_MAJOR_VERSION = process.versions.node.split('.')[0];
if (NODE_MAJOR_VERSION > 14) {
const dns = require('node:dns');
dns.setDefaultResultOrder('ipv4first');
}

function checkVersion(userSettings) {
var semver = require('semver');
if (!semver.satisfies(process.version,">=8.9.0")) {
if (!semver.satisfies(process.version,">=12.0.0")) {
// TODO: in the future, make this a hard error.
// var e = new Error("Unsupported version of Node.js");
// e.code = "unsupported_version";
Expand Down