{"version":"1.0","type":"rich","title":"node-websocketd","description":"This example demonstrates a lightweight Node.js port of the websocketd tool, which exposes a command-line script over a WebSocket connection. It shows how a spawned child process can receive input from and send output to a connected browser client in real time. The implementation uses the `ws` Server to handle WebSocket connections, `websocket-stream` to create a duplex stream over the socket, and `child_process.spawn` to execute the user-supplied command. Standard input and output are piped between the stream and the spawned process, with the process being killed when the stream ends.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-7880103?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}