You're viewing a comment by respectTheCode and its responses.

respectTheCode Permalink
September 17, 2011, 13:02

You can actually take 4 lines of code out by passing the end function directly to the end event listener. For example

request.addListener('end', function() {
  proxy_request.end();
});

can be written as

request.addListener('end', proxy_request.end);

Comment Responses

iRespectTheCode Permalink
July 05, 2013, 14:59

No, I think this won't work:
Peter's code passes proxy_request as this to proxy_request.end whereas yours drops the context. I guess it would crash.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "network_215": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.