Skip to content
This repository

routing proxy 'this' reference bug? #365

Merged
merged 1 commit into from over 1 year ago

3 participants

Anders D. Johnson Anthony BARRE Charlie Robbins
Anders D. Johnson

I think this was a bug in the RoutingProxy listener binding code. But I'm not sure. Anyway, it works better for me now in my application, where I'm binding multiple "once" listeners to a single proxy.

Anthony BARRE

+1

Charlie Robbins indexzero merged commit 025adc2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 13, 2013
Anders D. Johnson adjohnson916 fix 'this' reference in routing proxy listener bindings 15afc23
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/node-http-proxy/routing-proxy.js
2  lib/node-http-proxy/routing-proxy.js
@@ -60,7 +60,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) {
60 60 this.on('newListener', function (evt) {
61 61 if (evt === 'proxyError' || evt === 'webSocketProxyError') {
62 62 Object.keys(self.proxies).forEach(function (key) {
63   - self.proxies[key].on(evt, this.emit.bind(this, evt));
  63 + self.proxies[key].on(evt, self.emit.bind(self, evt));
64 64 });
65 65 }
66 66 });

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.