If the proxy reads from the origin faster than we can write to the client, node has to buffer data. It would be better if we stopped reading from the origin under these circumstances. This can be accomplished by checking the return value of the stream.write() call--if false, then data needs to be buffered; in this case we need to stop reading from the origin until the drain event is received.
If the proxy reads from the origin faster than we can write to the client, node has to buffer data. It would be better if we stopped reading from the origin under these circumstances. This can be accomplished by checking the return value of the stream.write() call--if
false
, then data needs to be buffered; in this case we need to stop reading from the origin until thedrain
event is received.