1 const { spawn } = require("child_process");
2 const WebSocket = require("ws");
5 const wss = new WebSocket.Server({ port: 8081 });
7 wss.on("connection", ws => {
12 const setupConnection = ws => {
15 ed.stdout.on("data", data => {
19 ed.on("close", code => {
23 ws.on("message", message => {
25 ed.stdin.write(message);
29 ws.send("Welcome to Ed on the Web!\n");