proxy-chain 2.7.1 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +53 -62
  2. package/dist/anonymize_proxy.d.ts +2 -6
  3. package/dist/anonymize_proxy.d.ts.map +1 -1
  4. package/dist/anonymize_proxy.js +27 -44
  5. package/dist/anonymize_proxy.js.map +1 -1
  6. package/dist/chain.d.ts +1 -8
  7. package/dist/chain.d.ts.map +1 -1
  8. package/dist/chain.js +15 -21
  9. package/dist/chain.js.map +1 -1
  10. package/dist/chain_socks.d.ts +1 -6
  11. package/dist/chain_socks.d.ts.map +1 -1
  12. package/dist/chain_socks.js +9 -13
  13. package/dist/chain_socks.js.map +1 -1
  14. package/dist/custom_connect.d.ts.map +1 -1
  15. package/dist/custom_connect.js +3 -7
  16. package/dist/custom_connect.js.map +1 -1
  17. package/dist/custom_response.d.ts +0 -2
  18. package/dist/custom_response.d.ts.map +1 -1
  19. package/dist/custom_response.js +1 -5
  20. package/dist/custom_response.js.map +1 -1
  21. package/dist/direct.d.ts +1 -5
  22. package/dist/direct.d.ts.map +1 -1
  23. package/dist/direct.js +7 -12
  24. package/dist/direct.js.map +1 -1
  25. package/dist/forward.d.ts +0 -4
  26. package/dist/forward.d.ts.map +1 -1
  27. package/dist/forward.js +17 -25
  28. package/dist/forward.js.map +1 -1
  29. package/dist/forward_socks.d.ts +0 -1
  30. package/dist/forward_socks.d.ts.map +1 -1
  31. package/dist/forward_socks.js +15 -23
  32. package/dist/forward_socks.js.map +1 -1
  33. package/dist/index.d.ts +6 -6
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +5 -8
  36. package/dist/index.js.map +1 -1
  37. package/dist/request_error.d.ts.map +1 -1
  38. package/dist/request_error.js +5 -17
  39. package/dist/request_error.js.map +1 -1
  40. package/dist/server.d.ts +4 -12
  41. package/dist/server.d.ts.map +1 -1
  42. package/dist/server.js +68 -133
  43. package/dist/server.js.map +1 -1
  44. package/dist/socket.d.ts +0 -2
  45. package/dist/socket.d.ts.map +1 -1
  46. package/dist/socket.js +1 -2
  47. package/dist/statuses.d.ts.map +1 -1
  48. package/dist/statuses.js +22 -27
  49. package/dist/statuses.js.map +1 -1
  50. package/dist/tcp_tunnel_tools.d.ts +2 -2
  51. package/dist/tcp_tunnel_tools.d.ts.map +1 -1
  52. package/dist/tcp_tunnel_tools.js +23 -41
  53. package/dist/tcp_tunnel_tools.js.map +1 -1
  54. package/dist/utils/count_target_bytes.d.ts +2 -3
  55. package/dist/utils/count_target_bytes.d.ts.map +1 -1
  56. package/dist/utils/count_target_bytes.js +4 -12
  57. package/dist/utils/count_target_bytes.js.map +1 -1
  58. package/dist/utils/decode_uri_component_safe.d.ts.map +1 -1
  59. package/dist/utils/decode_uri_component_safe.js +1 -5
  60. package/dist/utils/decode_uri_component_safe.js.map +1 -1
  61. package/dist/utils/get_basic.d.ts.map +1 -1
  62. package/dist/utils/get_basic.js +4 -8
  63. package/dist/utils/get_basic.js.map +1 -1
  64. package/dist/utils/is_hop_by_hop_header.d.ts.map +1 -1
  65. package/dist/utils/is_hop_by_hop_header.js +1 -5
  66. package/dist/utils/is_hop_by_hop_header.js.map +1 -1
  67. package/dist/utils/normalize_url_port.d.ts.map +1 -1
  68. package/dist/utils/normalize_url_port.js +1 -5
  69. package/dist/utils/normalize_url_port.js.map +1 -1
  70. package/dist/utils/parse_authorization_header.d.ts.map +1 -1
  71. package/dist/utils/parse_authorization_header.js +3 -7
  72. package/dist/utils/parse_authorization_header.js.map +1 -1
  73. package/dist/utils/redact_url.d.ts.map +1 -1
  74. package/dist/utils/redact_url.js +3 -7
  75. package/dist/utils/redact_url.js.map +1 -1
  76. package/dist/utils/valid_headers_only.d.ts.map +1 -1
  77. package/dist/utils/valid_headers_only.js +6 -10
  78. package/dist/utils/valid_headers_only.js.map +1 -1
  79. package/package.json +102 -93
  80. package/dist/utils/nodeify.d.ts +0 -2
  81. package/dist/utils/nodeify.d.ts.map +0 -1
  82. package/dist/utils/nodeify.js +0 -17
  83. package/dist/utils/nodeify.js.map +0 -1
package/package.json CHANGED
@@ -1,96 +1,105 @@
1
1
  {
2
- "name": "proxy-chain",
3
- "version": "2.7.1",
4
- "description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.",
5
- "main": "dist/index.js",
6
- "keywords": [
7
- "proxy",
8
- "squid",
9
- "apify",
10
- "tunnel",
11
- "puppeteer"
12
- ],
13
- "author": {
14
- "name": "Apify Technologies",
15
- "email": "support@apify.com",
16
- "url": "https://apify.com"
17
- },
18
- "contributors": [
19
- "Jan Curn <jan@apify.com>"
20
- ],
21
- "license": "Apache-2.0",
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/apify/proxy-chain"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/apify/proxy-chain/issues"
28
- },
29
- "homepage": "https://blog.apify.com/how-to-make-headless-chrome-and-puppeteer-use-a-proxy-server-with-authentication-249a21a79212",
30
- "files": [
31
- "dist",
32
- "!**/*.tsbuildinfo"
33
- ],
34
- "scripts": {
35
- "build:watch": "tsc -w",
36
- "build": "tsc",
37
- "clean": "rimraf dist",
38
- "prepublishOnly": "npm run build",
39
- "local-proxy": "node ./dist/run_locally.js",
40
- "test": "nyc cross-env NODE_OPTIONS=--insecure-http-parser mocha",
41
- "test:docker": "docker build --tag proxy-chain-tests --file test/Dockerfile . && docker run --add-host localhost-test:127.0.0.1 proxy-chain-tests",
42
- "test:docker:all": "bash scripts/test-docker-all.sh",
43
- "lint": "eslint .",
44
- "lint:fix": "eslint . --fix"
45
- },
46
- "engines": {
47
- "node": ">=14"
48
- },
49
- "devDependencies": {
50
- "@apify/eslint-config": "^1.0.0",
51
- "@apify/tsconfig": "^0.1.0",
52
- "@types/jest": "^28.1.2",
53
- "@types/node": "^18.8.3",
54
- "basic-auth": "^2.0.1",
55
- "basic-auth-parser": "^0.0.2",
56
- "body-parser": "^1.19.0",
57
- "chai": "^4.3.4",
58
- "cross-env": "^7.0.3",
59
- "eslint": "^9.18.0",
60
- "express": "^4.17.1",
61
- "faye-websocket": "^0.11.4",
62
- "got-scraping": "^3.2.4-beta.0",
63
- "isparta": "^4.1.1",
64
- "mocha": "^10.0.0",
65
- "nyc": "^15.1.0",
66
- "portastic": "^1.0.1",
67
- "proxy": "^1.0.2",
68
- "puppeteer": "^19.6.3",
69
- "request": "^2.88.2",
70
- "rimraf": "^4.1.2",
71
- "sinon": "^13.0.2",
72
- "sinon-stub-promise": "^4.0.0",
73
- "socksv5": "^0.0.6",
74
- "through": "^2.3.8",
75
- "ts-node": "^10.2.1",
76
- "typescript": "^4.4.3",
77
- "typescript-eslint": "^8.20.0",
78
- "underscore": "^1.13.1",
79
- "ws": "^8.2.2"
80
- },
81
- "nyc": {
82
- "reporter": [
83
- "text",
84
- "html",
85
- "lcov"
86
- ],
87
- "exclude": [
88
- "**/test/**"
89
- ]
90
- },
91
- "dependencies": {
92
- "socks": "^2.8.3",
93
- "socks-proxy-agent": "^8.0.3",
94
- "tslib": "^2.3.1"
2
+ "name": "proxy-chain",
3
+ "version": "3.0.0-beta.1",
4
+ "description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
95
11
  }
12
+ },
13
+ "keywords": [
14
+ "proxy",
15
+ "squid",
16
+ "apify",
17
+ "tunnel",
18
+ "puppeteer"
19
+ ],
20
+ "author": {
21
+ "name": "Apify Technologies",
22
+ "email": "support@apify.com",
23
+ "url": "https://apify.com"
24
+ },
25
+ "contributors": [
26
+ "Jan Curn <jan@apify.com>"
27
+ ],
28
+ "license": "Apache-2.0",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/apify/proxy-chain"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/apify/proxy-chain/issues"
35
+ },
36
+ "homepage": "https://blog.apify.com/how-to-make-headless-chrome-and-puppeteer-use-a-proxy-server-with-authentication-249a21a79212",
37
+ "files": [
38
+ "dist",
39
+ "!**/*.tsbuildinfo"
40
+ ],
41
+ "scripts": {
42
+ "build:watch": "tsc -w",
43
+ "build": "tsc",
44
+ "clean": "rimraf dist",
45
+ "prepublishOnly": "npm run build",
46
+ "local-proxy": "tsx test/utils/run_locally.js",
47
+ "test": "nyc cross-env NODE_OPTIONS=--insecure-http-parser mocha 'test/unit/**/*.js' 'test/e2e/**/*.js'",
48
+ "test:unit": "mocha 'test/unit/**/*.js'",
49
+ "test:e2e": "nyc cross-env NODE_OPTIONS=--insecure-http-parser mocha 'test/e2e/**/*.js'",
50
+ "test:docker": "docker build --tag proxy-chain-tests --file test/Dockerfile . && docker run --add-host localhost-test:127.0.0.1 proxy-chain-tests",
51
+ "test:docker:all": "bash scripts/test-docker-all.sh",
52
+ "lint": "eslint .",
53
+ "lint:fix": "eslint . --fix"
54
+ },
55
+ "engines": {
56
+ "node": ">=20.11"
57
+ },
58
+ "devDependencies": {
59
+ "@apify/eslint-config": "^1.0.0",
60
+ "@apify/tsconfig": "^0.1.0",
61
+ "@types/jest": "^28.1.2",
62
+ "@types/node": "^20.19.29",
63
+ "basic-auth": "^2.0.1",
64
+ "basic-auth-parser": "^0.0.2",
65
+ "body-parser": "^1.19.0",
66
+ "chai": "^4.3.4",
67
+ "cross-env": "^7.0.3",
68
+ "eslint": "^9.18.0",
69
+ "express": "^4.17.1",
70
+ "faye-websocket": "^0.11.4",
71
+ "got-scraping": "^3.2.4-beta.0",
72
+ "isparta": "^4.1.1",
73
+ "mocha": "^10.0.0",
74
+ "nyc": "^15.1.0",
75
+ "portastic": "^1.0.1",
76
+ "proxy": "^1.0.2",
77
+ "puppeteer": "^19.6.3",
78
+ "request": "^2.88.2",
79
+ "rimraf": "^4.1.2",
80
+ "sinon": "^13.0.2",
81
+ "sinon-stub-promise": "^4.0.0",
82
+ "socksv5": "^0.0.6",
83
+ "through": "^2.3.8",
84
+ "tsx": "^4.21.0",
85
+ "typescript": "^5.9.3",
86
+ "typescript-eslint": "^8.20.0",
87
+ "underscore": "^1.13.1",
88
+ "ws": "^8.2.2"
89
+ },
90
+ "nyc": {
91
+ "reporter": [
92
+ "text",
93
+ "html",
94
+ "lcov"
95
+ ],
96
+ "exclude": [
97
+ "**/test/**"
98
+ ]
99
+ },
100
+ "dependencies": {
101
+ "socks": "^2.8.3",
102
+ "socks-proxy-agent": "^8.0.3",
103
+ "tslib": "^2.3.1"
104
+ }
96
105
  }
@@ -1,2 +0,0 @@
1
- export declare const nodeify: <T>(promise: Promise<T>, callback?: ((error: Error | null, result?: T | undefined) => void) | undefined) => Promise<T>;
2
- //# sourceMappingURL=nodeify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeify.d.ts","sourceRoot":"","sources":["../../src/utils/nodeify.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,+CAAqD,KAAK,GAAG,IAAI,6BAAiB,IAAI,4BAczG,CAAC"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nodeify = void 0;
4
- // Replacement for Bluebird's Promise.nodeify()
5
- const nodeify = async (promise, callback) => {
6
- if (typeof callback !== 'function')
7
- return promise;
8
- promise.then((result) => callback(null, result), callback).catch((error) => {
9
- // Need to .catch because it doesn't crash the process on Node.js 14
10
- process.nextTick(() => {
11
- throw error;
12
- });
13
- });
14
- return promise;
15
- };
16
- exports.nodeify = nodeify;
17
- //# sourceMappingURL=nodeify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeify.js","sourceRoot":"","sources":["../../src/utils/nodeify.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AACxC,MAAM,OAAO,GAAG,KAAK,EAAK,OAAmB,EAAE,QAAoD,EAAc,EAAE;IACtH,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC;IAEnD,OAAO,CAAC,IAAI,CACR,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAClC,QAAQ,CACX,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACd,oEAAoE;QACpE,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;YAClB,MAAM,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAdW,QAAA,OAAO,WAclB"}