@@ -45,7 +45,8 @@ function impl (req, resOrSocket, headOrNil, {
45
45
onReq,
46
46
onRes
47
47
} , onProxyError ) {
48
- // NOTE http2.Http2ServerRequest doesn't forward stream errors.
48
+ // XXX http2.Http2ServerRequest doesn't forward stream errors.
49
+ // (https://github.com/nodejs/node/issues/15359)
49
50
( req . stream || req ) . on ( 'error' , onError )
50
51
resOrSocket . on ( 'error' , onError )
51
52
@@ -168,9 +169,10 @@ function proxy (req, resOrSocket, options, onRes, onError) {
168
169
callback ( err )
169
170
}
170
171
} )
171
- // NOTE http.ClientRequest doesn't emit 'aborted'. Instead it emits
172
+ // XXX http.ClientRequest doesn't emit 'aborted'. Instead it emits
172
173
// a "socket hang up" error.
173
174
// .on('aborted', () => callback(new createError.BadGateway('socket hang up')))
175
+ // (https://github.com/nodejs/node/pull/15270)
174
176
. on ( 'timeout' , ( ) => callback ( createError ( 'gateway timeout' , null , 504 ) ) )
175
177
. on ( 'response' , proxyRes => {
176
178
try {
@@ -239,6 +241,7 @@ function proxy (req, resOrSocket, options, onRes, onError) {
239
241
)
240
242
241
243
// XXX Do we need to handle `proxyRes.on('error', ...)`?
244
+ // (https://github.com/nodejs/node/issues/15360)
242
245
243
246
proxySocket
244
247
. on ( 'error' , callback )
0 commit comments