Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: http-party/node-http-proxy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.8.6
Choose a base ref
...
head repository: http-party/node-http-proxy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.8.7
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 21, 2012

  1. [fix] Handle errors on request object

    Sometimes a request emits `error` event with a `Parse Error`.
    mmalecki committed Dec 21, 2012
    Copy the full SHA
    edfe869 View commit details

Commits on Dec 22, 2012

  1. [fix] Don't remove error listener after response ends

    In some rare cases, `error` event might still be emitted after the
    response has ended. This is (most likely) a bug in the `node` core.
    mmalecki committed Dec 22, 2012
    Copy the full SHA
    223eacd View commit details
  2. [dist] Bump version to 0.8.7

    mmalecki committed Dec 22, 2012
    Copy the full SHA
    26d3646 View commit details
Showing with 11 additions and 3 deletions.
  1. +10 −2 lib/node-http-proxy/http-proxy.js
  2. +1 −1 package.json
12 changes: 10 additions & 2 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
@@ -271,8 +271,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
response.on('end', function () {
ended = true;
if (!errState) {
reverseProxy.removeListener('error', proxyError);

try { res.end() }
catch (ex) { console.error("res.end error: %s", ex.message) }

@@ -318,6 +316,11 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
socket.once('error', proxyError);
});

//
// Handle 'error' events from the `req` (e.g. `Parse Error`).
//
req.on('error', proxyError);

//
// If `req` is aborted, we abort our `reverseProxy` request as well.
//
@@ -731,6 +734,11 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
socket.once('error', proxyError);
});

//
// Handle 'error' events from the `req` (e.g. `Parse Error`).
//
req.on('error', proxyError);

try {
//
// Attempt to write the upgrade-head to the reverseProxy
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "http-proxy",
"version": "0.8.6",
"version": "0.8.7",
"description": "A full-featured http reverse proxy for node.js",
"author": "Nodejitsu Inc. <info@nodejitsu.com>",
"maintainers": [