From 41cec5a02c36687279ad2628f7c46327f7ff3e2d Mon Sep 17 00:00:00 2001 From: Kaciras Date: Tue, 19 Dec 2023 10:09:54 +0800 Subject: [PATCH] update deps, fix tests --- index.spec.ts | 6 +-- package.json | 6 +-- pnpm-lock.yaml | 126 ++++++++++++++++++++++--------------------------- 3 files changed, 62 insertions(+), 76 deletions(-) diff --git a/index.spec.ts b/index.spec.ts index 3d38db6..a583be1 100644 --- a/index.spec.ts +++ b/index.spec.ts @@ -37,7 +37,7 @@ function setupSocksServer(authenticate?: AuthFn) { filter(port: number, host: string, socket: net.Socket) { inbound = socket; - return Promise.resolve(); + return true; }, }); @@ -83,9 +83,7 @@ const secureServer = setupHttpServer({ const plainProxy = setupSocksServer(); const secureProxy = setupSocksServer((username, password) => { - return username === "foo" && password === "bar" - ? Promise.resolve() - : Promise.reject(new Error("Authenticate failed")); + return username === "foo" && password === "bar"; }); async function verifyFetchFailed(server: Mockttp | string, dispatcher: Dispatcher, cause?: unknown) { diff --git a/package.json b/package.json index 6165c16..c76eca1 100644 --- a/package.json +++ b/package.json @@ -34,17 +34,17 @@ "undici": "^6.0.1" }, "devDependencies": { - "@e9x/simple-socks": "1.0.0-beta.1", + "@e9x/simple-socks": "1.0.0", "@jest/globals": "^29.7.0", "@kaciras/eslint-config-core": "^2.6.1", "@kaciras/eslint-config-typescript": "^2.6.2", "@types/ws": "^8.5.10", - "eslint": "^8.55.0", + "eslint": "^8.56.0", "jest": "^29.7.0", "mockttp": "^3.10.0", "ts-jest": "^29.1.1", "type-coverage": "^2.27.0", "typescript": "^5.3.3", - "ws": "^8.15.0" + "ws": "^8.15.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df915d6..5bc4e4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,23 +14,23 @@ dependencies: devDependencies: '@e9x/simple-socks': - specifier: 1.0.0-beta.1 - version: 1.0.0-beta.1 + specifier: 1.0.0 + version: 1.0.0 '@jest/globals': specifier: ^29.7.0 version: 29.7.0 '@kaciras/eslint-config-core': specifier: ^2.6.1 - version: 2.6.1(eslint@8.55.0) + version: 2.6.1(eslint@8.56.0) '@kaciras/eslint-config-typescript': specifier: ^2.6.2 - version: 2.6.2(eslint@8.55.0)(typescript@5.3.3) + version: 2.6.2(eslint@8.56.0)(typescript@5.3.3) '@types/ws': specifier: ^8.5.10 version: 8.5.10 eslint: - specifier: ^8.55.0 - version: 8.55.0 + specifier: ^8.56.0 + version: 8.56.0 jest: specifier: ^29.7.0 version: 29.7.0 @@ -47,8 +47,8 @@ devDependencies: specifier: ^5.3.3 version: 5.3.3 ws: - specifier: ^8.15.0 - version: 8.15.0 + specifier: ^8.15.1 + version: 8.15.1 packages: @@ -394,25 +394,20 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@e9x/simple-socks@1.0.0-beta.1: - resolution: {integrity: sha512-wUG66zqCRHVq3ZJAurMoB/2jmVGNpRQtbPcvXQfF4jqoHcHmQQgCUwBwWZgvj5Zs+bMVhIgdIAbBS1cwJYumoA==} + /@e9x/simple-socks@1.0.0: + resolution: {integrity: sha512-o1peEKSTfL0JOg+loDFoVK+I2PgMf1mT8m/dLI83KNJES+S8LGzzdF5DogBKVUp1KQfXNHT+w/O43x2KJ4IxzA==} + engines: {node: '>=18.0.0'} dependencies: binary: 0.3.0 - debug: 4.3.4 - optionalDependencies: - ipaddr.js: 2.1.0 - socks: 2.7.1 - transitivePeerDependencies: - - supports-color dev: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.55.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.55.0 + eslint: 8.56.0 eslint-visitor-keys: 3.4.3 dev: true @@ -428,7 +423,7 @@ packages: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.23.0 + globals: 13.24.0 ignore: 5.3.0 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -438,8 +433,8 @@ packages: - supports-color dev: true - /@eslint/js@8.55.0: - resolution: {integrity: sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==} + /@eslint/js@8.56.0: + resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -505,7 +500,7 @@ packages: graphql: 15.8.0 iterall: 1.3.0 symbol-observable: 1.2.0 - ws: 8.15.0 + ws: 8.15.1 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -517,10 +512,10 @@ packages: '@types/ws': 8.5.10 duplexify: 3.7.1 inherits: 2.0.4 - isomorphic-ws: 4.0.1(ws@8.15.0) + isomorphic-ws: 4.0.1(ws@8.15.1) readable-stream: 2.3.8 safe-buffer: 5.2.1 - ws: 8.15.0 + ws: 8.15.1 xtend: 4.0.2 transitivePeerDependencies: - bufferutil @@ -807,37 +802,37 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@kaciras/eslint-config-core@2.6.1(eslint@8.55.0): + /@kaciras/eslint-config-core@2.6.1(eslint@8.56.0): resolution: {integrity: sha512-dwV8S/d3a2KujWd1jxU+0HIF2ZcOMSUsl+QPrNvRRS6MGNwpSpvHf7m5+zNJQMqeX8lyoJNlq3QOMuUT24/L0Q==} engines: {node: '>=14'} peerDependencies: eslint: '>=8' dependencies: - '@kaciras/eslint-plugin': 2.6.1(eslint@8.55.0) - eslint: 8.55.0 + '@kaciras/eslint-plugin': 2.6.1(eslint@8.56.0) + eslint: 8.56.0 dev: true - /@kaciras/eslint-config-typescript@2.6.2(eslint@8.55.0)(typescript@5.3.3): + /@kaciras/eslint-config-typescript@2.6.2(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-wG5W5S8OQzh71Tsd2mhUatpLzlXCDNB5BO6eJObvjVbtr0VNK0U2MSpowWlNYVAuZcizUXoCaELPh5jvqRhPFg==} engines: {node: '>=14'} peerDependencies: eslint: '>=8' dependencies: - '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.55.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.9.1(eslint@8.55.0)(typescript@5.3.3) - eslint: 8.55.0 + '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.9.1(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@kaciras/eslint-plugin@2.6.1(eslint@8.55.0): + /@kaciras/eslint-plugin@2.6.1(eslint@8.56.0): resolution: {integrity: sha512-kn/PJfl0MPVqlye5GQ+m8OrRr8sx6WzRJkerWm1wBhW/e5uziZ0GhRHwY0r2+26esur2xjNJaECrDQbKJKLBeQ==} peerDependencies: eslint: '>=8' dependencies: - eslint: 8.55.0 - eslint-utils: 3.0.0(eslint@8.55.0) + eslint: 8.56.0 + eslint-utils: 3.0.0(eslint@8.56.0) dev: true /@nodelib/fs.scandir@2.1.5: @@ -984,7 +979,7 @@ packages: '@types/yargs-parser': 21.0.2 dev: true - /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -996,13 +991,13 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.9.1(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/type-utils': 6.9.1(eslint@8.55.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.9.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.9.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.9.1(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.55.0 + eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 @@ -1013,7 +1008,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/parser@6.9.1(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1028,7 +1023,7 @@ packages: '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.55.0 + eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: - supports-color @@ -1042,7 +1037,7 @@ packages: '@typescript-eslint/visitor-keys': 6.9.1 dev: true - /@typescript-eslint/type-utils@6.9.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/type-utils@6.9.1(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1053,9 +1048,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.3.3) - '@typescript-eslint/utils': 6.9.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.9.1(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 - eslint: 8.55.0 + eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: @@ -1088,19 +1083,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.9.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/utils@6.9.1(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.4 '@typescript-eslint/scope-manager': 6.9.1 '@typescript-eslint/types': 6.9.1 '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.3.3) - eslint: 8.55.0 + eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -1847,13 +1842,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils@3.0.0(eslint@8.55.0): + /eslint-utils@3.0.0(eslint@8.56.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.55.0 + eslint: 8.56.0 eslint-visitor-keys: 2.1.0 dev: true @@ -1867,15 +1862,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.55.0: - resolution: {integrity: sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==} + /eslint@8.56.0: + resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.55.0 + '@eslint/js': 8.56.0 '@humanwhocodes/config-array': 0.11.13 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -1895,7 +1890,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.23.0 + globals: 13.24.0 graphemer: 1.4.0 ignore: 5.3.0 imurmurhash: 0.1.4 @@ -2246,8 +2241,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -2473,13 +2468,6 @@ packages: engines: {node: '>= 0.10'} dev: true - /ipaddr.js@2.1.0: - resolution: {integrity: sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==} - engines: {node: '>= 10'} - requiresBuild: true - dev: true - optional: true - /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -2535,12 +2523,12 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /isomorphic-ws@4.0.1(ws@8.15.0): + /isomorphic-ws@4.0.1(ws@8.15.1): resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: ws: '*' dependencies: - ws: 8.15.0 + ws: 8.15.1 dev: true /istanbul-lib-coverage@3.2.0: @@ -3265,7 +3253,7 @@ packages: http-encoding: 1.5.1 http2-wrapper: 2.2.1 https-proxy-agent: 5.0.1 - isomorphic-ws: 4.0.1(ws@8.15.0) + isomorphic-ws: 4.0.1(ws@8.15.1) lodash: 4.17.21 lru-cache: 7.18.3 native-duplexpair: 1.0.0 @@ -3279,7 +3267,7 @@ packages: socks-proxy-agent: 7.0.0 typed-error: 3.2.2 uuid: 8.3.2 - ws: 8.15.0 + ws: 8.15.1 transitivePeerDependencies: - bufferutil - encoding @@ -4255,8 +4243,8 @@ packages: signal-exit: 3.0.7 dev: true - /ws@8.15.0: - resolution: {integrity: sha512-H/Z3H55mrcrgjFwI+5jKavgXvwQLtfPCUEp6pi35VhoB0pfcHnSoyuTzkBEZpzq49g1193CUEwIvmsjcotenYw==} + /ws@8.15.1: + resolution: {integrity: sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1