Advertisement
metalx1000

Websocket Examples for BASH Shell Scripts

Jul 6th, 2021
1,765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #install client and server
  2. sudo apt install node-wscat websocketd
  3.  
  4. #server
  5. #websocketd is a websocket server that sends the output of a command to the client when they connect
  6. websocketd --port=4444 bash -c ls
  7. websocketd --port=4444 bash -c "while [ 1 ];do date;sleep 1;done"
  8.  
  9. #client
  10. wscat -c "ws://localhost:4444"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement