From 486dc99ba300d5210f93b7b3294301b7fc8ac3f0 Mon Sep 17 00:00:00 2001 From: jgart Date: Tue, 31 Aug 2021 10:12:36 -0400 Subject: Add websocketd as a possible alternative to xtermjs Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets. --- topics/ui/adding-terminal-output.gmi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'topics/ui/adding-terminal-output.gmi') diff --git a/topics/ui/adding-terminal-output.gmi b/topics/ui/adding-terminal-output.gmi index a6dd895..a3e3350 100644 --- a/topics/ui/adding-terminal-output.gmi +++ b/topics/ui/adding-terminal-output.gmi @@ -5,3 +5,25 @@ GeneNetwork runs external tools. We would like to have an option for (advanced) => https://xtermjs.org/docs/api/addons/attach/ xterm.js websocket support As GN3 (REST) API handles calling external tools it kinda make sense to handle the terminal output page through GN3 and communicate through websockets. But first I'll do a Sinatra test run. + +## possible xtermjs alternative + +=> https://github.com/joewalnes/websocketd possible xtermjs alternative + +=> http://websocketd.com/ home page with tutorials in various languages + +They forgot scheme: + +``` +(define (websocketd-loop n) +"Count from 1 to n, pausing +for a second between each iteration" + (if (zero? n) + 'done! + (begin + (display n) + (display "\n") + (sleep 1) + (websocketd-loop (- n 1))))) +``` + -- cgit v1.2.3