From: charleswrayjr Date: Tue, 9 Sep 2025 21:14:04 +0000 (-0500) Subject: Removing debug logging from getStatus method on vpn.controller.js. X-Git-Url: https://git.phasecustomsoft.com/?a=commitdiff_plain;h=494b524c692cf909dd1889a67d9d8d5417d15454;p=phs-api.git Removing debug logging from getStatus method on vpn.controller.js. --- diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index ea62433..664350f 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -268,8 +268,10 @@ module.exports = { // Disconnect client via management interface const client = new net.Socket(); - client.connect(7505, 'localhost', () => { - logger.warn('Connected to OpenVPN management interface'); + let connectionAttempted = false; + client.on('connect', () => { + logger.info('Connected to OpenVPN management interface'); + connectionAttempted = true; client.write(`client-kill ${clientName}\n`); }); @@ -318,6 +320,7 @@ module.exports = { client.destroy(); next(new createError(500, `Management interface connection failed: ${err.message}`)); }); + client.connect(7505, '192.168.1.62'); // Use host IP } catch (error) { next(new createError(500, `Failed to process disconnection: ${error.message}`)); }