Skip to content

Commit

Permalink
2.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshGlazebrook committed Apr 10, 2024
1 parent 992b002 commit a2a06d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 8 additions & 2 deletions src/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit a2a06d9

Please sign in to comment.