From 29c1264b42b69162a17b9f00a457e1c14a5d331d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 May 2022 11:04:48 -0700 Subject: [PATCH] Add warning in demo code about flow control Fixes #3760 --- demo/server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/server.js b/demo/server.js index c0d5e1f6..71a9d36a 100644 --- a/demo/server.js +++ b/demo/server.js @@ -114,6 +114,9 @@ function startServer() { } const send = USE_BINARY ? bufferUtf8(ws, 5) : buffer(ws, 5); + // WARNING: This is a naive implementation that will not throttle the flow of data. This means + // it could flood the communication channel and make the terminal unresponsive. Learn more about + // the problem and how to implement flow control at https://xtermjs.org/docs/guides/flowcontrol/ term.on('data', function(data) { try { send(data);