mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #102 from Tyriar/dont_crash_demo_refresh
Don't crash demo server on refresh
This commit is contained in:
+5
-2
@@ -29,9 +29,12 @@ app.ws('/bash', function(ws, req) {
|
||||
cwd: process.env.PWD,
|
||||
env: process.env
|
||||
});
|
||||
|
||||
term.on('data', function(data) {
|
||||
ws.send(data);
|
||||
try {
|
||||
ws.send(data);
|
||||
} catch (ex) {
|
||||
// The WebSocket is not open, ignore
|
||||
}
|
||||
});
|
||||
ws.on('message', function(msg) {
|
||||
term.write(msg);
|
||||
|
||||
Reference in New Issue
Block a user