- Bugfix:
closeTunnel()function didn't work because ofrunningServers[port].connections.forEach is not a functionerror (see issue #127)
- Bugfix:
parseUrl()result now always includes port forhttp(s),ftpandws(s)(even if explicitly specified port is the default one) This fixes #123.
- BREAKING: The
parseUrl()function slightly changed its behavior (see README for details):- it no longer returns an object on invalid URLs and throws an exception instead
- it URI-decodes username and password if possible (if not, the function keeps the username and password as is)
- it adds back
authproperty for better backwards compatibility
- The above change should make it possible to pass upstream proxy URLs containing
special characters, such as
http://user:pass:wrd@proxy.example.comorhttp://us%35er:passwrd@proxy.example.com. The parsing is done on a best-effort basis. The safest way is to always URI-encode username and password before constructing the URL, according to RFC 3986. This change should finally fix issues: #89, #67, and #108 - BREAKING: Improved error handling in
createTunnel()andprepareRequestFunction()functions and provided better error messages. Both functions now fail if the upstream proxy URL contains colon (:) character in the username, in order to comply with RFC 7617. The functions now fail fast with a reasonable error, rather later and with cryptic errors. - BREAKING: The
createTunnel()function now lets the system assign potentially random listening TCP port, instead of the previous selection from range from 20000 to 60000. - BREAKING: The undocumented
findFreePort()function was moved from tools.js to test/tools.js - Added the ability to access proxy CONNECT headers for proxy tunneling.
- Removed dependency on Node.js internal modules, hopefully allowing usage of this library in Electron.
- Got rid of the "portastic" NPM package and thus reduced bundle size by ~50%
- Various code improvements and better tests.
- Updated packages.
- Bugfix: Added back the
schemefield to result fromparseUrl()
- Bugfix:
parseUrl()function now handles IPv6 and other previously unsupported URLs. Fixes issues #89 and #67.
- Bugfix:
closeTunnel()function was returning invalid value. see PR #98.
Proxy.Servernow supportsport: 0option to assign the port randomly, see PR #98.anonymizeProxy()now uses the above port assignment rather than polling for random port => better performance- Updated NPM packages
- Added checks for closed handlers, in order to prevent the
Cannot read property 'pipe' of nullerrors (see issue #64)
- Attempt to fix an unhandled exception in
HandlerTunnelChain.onTrgRequestConnect(see issue #64) - Code cleanup
- Fixed unhandled
TypeError: Cannot read property '_httpMessage' of nullexception inHandlerTunnelChain.onTrgRequestConnect(see issue #63)
- Bugfix: Prevented attempted double-sending of certain HTTP responses to client, which might have caused some esoteric errors
- Error responses now by default have
Content-Type: text/plain; charset=utf-8instead oftext/html; charset=utf-8or missing one.
- Increased socket end/destroy timeouts from 100ms to 1000ms, to ensure the client receives the data.
- BREAKING CHANGE: Dropped support for Node.js 9 and lower.
- BUGFIX: Consume source socket errors to avoid unhandled exceptions. Fixes Issue #53.
- BUGFIX: Renamed misspelled
TrailersHTTP header toTrailer. - Replaced
bluebirddependency with native Promises. - Upgraded NPM dev dependencies.
- Fixed broken tests caused by newly introduced strict HTTP parsing in Node.js.
- Fixed broken test on Node.js 10 by adding
NODE_OPTIONS=--insecure-http-parserenv var tonpm test.
- More informative messages for "Invalid upstreamProxyUrl" errors
- Bugfix: Prevent the
"TypeError: hostHeader.startsWith is not a functionerror inHandlerForwardby not forwarding duplicateHostheaders
- BREAKING CHANGE:
closeAnonymizedProxythrows on invalid proxy URL - Bugfix: Attempt to prevent the unhandled "write after end" error
- Bugfix: Proxy no longer attempts to forward invalid HTTP status codes and fails with 500 Internal Server Error
- Fixed closing of sockets on Node 10+
- Fixed and improved unit tests to also work on Node 10+, update dev dependencies
- Changed HTTP 200 message from
Connection establishedtoConnection Establishedto be according to standards - Proxy source/target sockets are set to no delay (i.e. disabled Nagle's algorithm), to avoid any caching delays
- Improved logging
- Updated README
- Bugfix: Added
Hostheader toHTTP CONNECTrequests to upstream proxies
- Bugfix: Invalid request headers broke proxy chain connection. Now they will be skipped instead.
- Bugfix: large custom responses were not delivered completely because the socket was closed too early
- Bugfix: 'requestFailed' was emitting
{ request, err }instead of{ request, error }
- BREAKING: The 'requestFailed' event now emits object
{ request, error }instead of justerror
- Bugfix: When target URL cannot be parsed instead of crashing, throw RequestError
- Minor improvement: HandlerBase.fail() now supports RequestError
- Renamed
customResponseFunctocustomResponseFunctionand changed parameters for more clarity
- Added
customResponseFuncoption toprepareRequestFunctionto support custom response to HTTP requests
- Updated project homepage in package.json
- Fix: anonymizeProxy() now supports upstream proxies with empty password
- Added
createTunnel()function to create tunnels through HTTP proxies for arbitrary TCP network connections (eq. connection to mongodb/sql database through HTTP proxy)
- Better error messages for common network errors
- Pass headers from target socket in HTTPS tunnel chains
- If connection is denied because of authentication error, optionally "prepareRequestFunction" can provide error message.
- When connection is only through socket, close srcSocket when trgSocket ends
- Fixed incorrect closing of ServerResponse object which caused phantomjs to mark resource requests as errors.
- Fixed missing variable in "Incorrect protocol" error message.
- Renamed project's GitHub organization
- Added Server.getConnectionIds() function
- Fixed "TypeError: The header content contains invalid characters" bug
- fixed uncaught error events, code improved
- fixed a memory leak, improved logging and consolidated code
- added
connectionClosedevent to notify users about closed proxy connections
- added measuring of proxy stats - see
getConnectionStats()function
- added support for multiple headers with the same name (thx shershennm)
- Project created