@@ -240,6 +240,14 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
240
240
res . once ( 'drain' , function ( ) {
241
241
response . resume ( ) ;
242
242
} ) ;
243
+
244
+ //
245
+ // Force the `drain` event in 100ms if it hasn't
246
+ // happened on its own.
247
+ //
248
+ setTimeout ( function ( ) {
249
+ res . emit ( 'drain' ) ;
250
+ } , 100 ) ;
243
251
}
244
252
}
245
253
} ) ;
@@ -281,6 +289,14 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
281
289
reverseProxy . once ( 'drain' , function ( ) {
282
290
req . resume ( ) ;
283
291
} ) ;
292
+
293
+ //
294
+ // Force the `drain` event in 100ms if it hasn't
295
+ // happened on its own.
296
+ //
297
+ setTimeout ( function ( ) {
298
+ reverseProxy . emit ( 'drain' ) ;
299
+ } , 100 ) ;
284
300
}
285
301
}
286
302
} ) ;
@@ -356,6 +372,14 @@ HttpProxy.prototype._forwardRequest = function (req) {
356
372
forwardProxy . once ( 'drain' , function ( ) {
357
373
req . resume ( ) ;
358
374
} ) ;
375
+
376
+ //
377
+ // Force the `drain` event in 100ms if it hasn't
378
+ // happened on its own.
379
+ //
380
+ setTimeout ( function ( ) {
381
+ forwardProxy . emit ( 'drain' ) ;
382
+ } , 100 ) ;
359
383
}
360
384
} ) ;
361
385
@@ -448,6 +472,14 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
448
472
reverseProxy . incoming . socket . once ( 'drain' , function ( ) {
449
473
proxySocket . resume ( ) ;
450
474
} ) ;
475
+
476
+ //
477
+ // Force the `drain` event in 100ms if it hasn't
478
+ // happened on its own.
479
+ //
480
+ setTimeout ( function ( ) {
481
+ reverseProxy . incoming . socket . emit ( 'drain' ) ;
482
+ } , 100 ) ;
451
483
}
452
484
}
453
485
catch ( ex ) {
@@ -471,6 +503,14 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
471
503
proxySocket . once ( 'drain' , function ( ) {
472
504
reverseProxy . incoming . socket . resume ( ) ;
473
505
} ) ;
506
+
507
+ //
508
+ // Force the `drain` event in 100ms if it hasn't
509
+ // happened on its own.
510
+ //
511
+ setTimeout ( function ( ) {
512
+ proxySocket . emit ( 'drain' ) ;
513
+ } , 100 ) ;
474
514
}
475
515
}
476
516
catch ( ex ) {
@@ -635,6 +675,14 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
635
675
socket . once ( 'drain' , function ( ) {
636
676
reverseProxy . socket . resume ( ) ;
637
677
} ) ;
678
+
679
+ //
680
+ // Force the `drain` event in 100ms if it hasn't
681
+ // happened on its own.
682
+ //
683
+ setTimeout ( function ( ) {
684
+ socket . emit ( 'drain' ) ;
685
+ } , 100 ) ;
638
686
}
639
687
}
640
688
catch ( ex ) {
0 commit comments