proxy-chain 3.0.2-beta.20 → 3.0.2-beta.22

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.
package/README.md CHANGED
@@ -241,6 +241,8 @@ console.log(`Proxy server is listening on port ${server.port}`);
241
241
 
242
242
  **Note:** Custom agents are only supported for HTTP and HTTPS upstream proxies. SOCKS upstream proxies use direct socket connections and do not support custom agents.
243
243
 
244
+ **Note:** Pooling applies to requests for `http://` URLs, whether the upstream proxy is HTTP or HTTPS. Requests for `https://` URLs reach the upstream as a `CONNECT` tunnel. A connection that has carried a tunnel is never returned to the agent's pool, so each tunnel gets its own upstream connection, even with `keepAlive: true`. Requests sent inside one tunnel share its connection, but separate tunnels don't share connections.
245
+
244
246
  ## SOCKS support
245
247
  SOCKS protocol is supported for versions 4 and 5, specifically: `['socks', 'socks4', 'socks4a', 'socks5', 'socks5h']`, where `socks` will default to version 5.
246
248
 
package/dist/forward.js CHANGED
@@ -22,7 +22,7 @@ import { validHeadersOnly } from './utils/valid_headers_only.js';
22
22
  * Client <- Apify (HTTP) <- Upstream (HTTP) <- Web
23
23
  * ```
24
24
  */
25
- export const forward = async (request, response, handlerOpts) => new Promise(async (resolve, reject) => {
25
+ export const forward = async (request, response, handlerOpts) => new Promise((resolve, reject) => {
26
26
  const proxy = handlerOpts.upstreamProxyUrlParsed;
27
27
  const origin = proxy ? proxy.origin : request.url;
28
28
  const options = {
@@ -16,7 +16,7 @@ import { validHeadersOnly } from './utils/valid_headers_only.js';
16
16
  * Client <- Apify (HTTP) <- Upstream (SOCKS) <- Web
17
17
  * ```
18
18
  */
19
- export const forwardSocks = async (request, response, handlerOpts) => new Promise(async (resolve, reject) => {
19
+ export const forwardSocks = async (request, response, handlerOpts) => new Promise((resolve, reject) => {
20
20
  const agent = new SocksProxyAgent(handlerOpts.upstreamProxyUrlParsed);
21
21
  const options = {
22
22
  method: request.method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proxy-chain",
3
- "version": "3.0.2-beta.20",
3
+ "version": "3.0.2-beta.22",
4
4
  "description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",