apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
https://www.npmjs.com/package/proxy-chain
Apache License 2.0
804 stars 138 forks source link

refactor: Avoid accessing prototype in custom_connect #522

Closed JuroOravec closed 10 months ago

JuroOravec commented 10 months ago

See the discussion here: https://github.com/apify/proxy-chain/issues/521#issuecomment-1685378805

NOTE: I tried running npm run test to ensure everything works. But the tests were failing because of other error (below) even before I made the change, so I can't ensure integrity.

$ npm run test

> proxy-chain@2.3.0 test
> nyc cross-env NODE_OPTIONS=--insecure-http-parser mocha --bail

(node:23123) Warning: Using insecure HTTP parsing
(Use `node --trace-warnings ...` to show where the warning was created)
  1) supports localAddress

  0 passing (2s)
  1 failing

  1) supports localAddress:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/presenter/repos/proxy-chain/test/server.js)
      at listOnTimeout (node:internal/timers:557:17)
      at processTimers (node:internal/timers:500:7)
jancurn commented 10 months ago

@JuroOravec thanks for your help!