From 32e0c6699713696194f5560b0953b07e2f880f07 Mon Sep 17 00:00:00 2001 From: LucienHH <66429271+LucienHH@users.noreply.github.com> Date: Thu, 4 May 2023 17:58:55 +0100 Subject: [PATCH] Fix `followPort` option (#394) * Fix `followPort` option * Use correct default --- src/createClient.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createClient.js b/src/createClient.js index 17b9d31..154a8ae 100644 --- a/src/createClient.js +++ b/src/createClient.js @@ -20,8 +20,8 @@ function createClient (options) { const adVersion = ad.version?.split('.').slice(0, 3).join('.') // Only 3 version units client.options.version = options.version ?? (Options.Versions[adVersion] ? adVersion : Options.CURRENT_VERSION) - if (ad.port && options.followPort) { - client.options.port = ad.port + if (ad.portV4 && client.options.followPort) { + client.options.port = ad.portV4 } client.conLog?.(`Connecting to ${client.options.host}:${client.options.port} ${ad.motd} (${ad.levelName}), version ${ad.version} ${client.options.version !== ad.version ? ` (as ${client.options.version})` : ''}`)