feat: IP4P 合并进 IPv6; ProxyUtils 中增加 ipAddress

This commit is contained in:
xream
2024-07-18 18:35:22 +08:00
parent cddd1818fe
commit fea9de4fae
6 changed files with 51 additions and 16 deletions

View File

@@ -1,3 +1,4 @@
import * as ipAddress from 'ip-address';
// source: https://stackoverflow.com/a/36760050
const IPV4_REGEX = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
@@ -94,6 +95,7 @@ function getPolicyDescriptor(str) {
// })();
export {
ipAddress,
isIPv4,
isIPv6,
isValidPortNumber,