Created by: glasser
The Node http client (at least in 0.10.x) removes the socket error handler (which forwards errors from socket to request) before invoking 'upgrade'. So we need to put our error handler back on it if we don't want errors (eg ECONNRESET/EPIPE) talking to the server to throw.
See https://gist.github.com/glasser/6893545 for an example script showing why this is necessary.