From b7a94d426ac9231d101083ddaa57974c571039dd Mon Sep 17 00:00:00 2001 From: roughnecks Date: Sun, 12 Nov 2023 19:20:19 +0100 Subject: [PATCH] Prefer IPv4 Connections patch --- lib/xmpp/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/xmpp/index.js b/lib/xmpp/index.js index 04e4fcc..64e7a25 100644 --- a/lib/xmpp/index.js +++ b/lib/xmpp/index.js @@ -15,6 +15,10 @@ module.exports = (logger, config) => { const outgoing = require('../outgoing') this.jid = null + // prefer IPv4 connections + const dns = require('node:dns'); + dns.setDefaultResultOrder('ipv4first'); + // declare send chat/groupchat function this.send = async (to, message, type) => { logger.info(`Send ${type} message to ${to}`)