CCCPaste

Websocket Examples for BASH Shell Scripts

#install client and server
sudo apt install node-wscat websocketd

#server
#websocketd is a websocket server that sends the output of a command to the client when they connect 
websocketd --port=4444 bash -c ls
websocketd --port=4444 bash -c "while [ 1 ];do date;sleep 1;done"

#client
wscat -c "ws://localhost:4444"