(proxyReq, url)
| 153 | proxyReq.on('error', proxyError); |
| 154 | |
| 155 | function createErrorHandler(proxyReq, url) { |
| 156 | return function proxyError(err) { |
| 157 | if (req.socket.destroyed && err.code === 'ECONNRESET') { |
| 158 | server.emit('econnreset', err, req, res, url); |
| 159 | return proxyReq.abort(); |
| 160 | } |
| 161 | |
| 162 | if (clb) { |
| 163 | clb(err, req, res, url); |
| 164 | } else { |
| 165 | server.emit('error', err, req, res, url); |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | (options.buffer || req).pipe(proxyReq); |
| 171 |