From a2a06d9967edfaa317e6d20d33963b95a3e654e3 Mon Sep 17 00:00:00 2001 From: joshglazebrook Date: Tue, 9 Apr 2024 21:04:50 -0500 Subject: [PATCH] 2.8.3 --- package.json | 2 +- src/common/helpers.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2c89eb5..5cc2a68 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "socks", "private": false, - "version": "2.8.2", + "version": "2.8.3", "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", "main": "build/index.js", "typings": "typings/index.d.ts", diff --git a/src/common/helpers.ts b/src/common/helpers.ts index 42d36f0..fc13fb7 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -236,9 +236,15 @@ export function ipToBuffer(ip: string): Buffer { } else if (net.isIPv6(ip)) { // Handle IPv6 addresses const address = new Address6(ip); - return Buffer.from(address.canonicalForm().split(":").map(segment => segment.padStart(4, '0')).join(''), 'hex'); + return Buffer.from( + address + .canonicalForm() + .split(':') + .map((segment) => segment.padStart(4, '0')) + .join(''), + 'hex', + ); } else { throw new Error('Invalid IP address format'); } } -