Advertisement
metalx1000

Websocket Shell and HTML Useage

Dec 2nd, 2024
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #install server
  2. sudo apt install 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. # maybe you want to monitor dmesg output
  10. sudo dmesg -w > dmesg
  11. websocketd --port=4444 bash -c "tail -F dmesg"
  12.  
  13.  
  14. #client
  15. # If you want to connect from the shell
  16. sudo apt install node-wscat
  17. wscat -c "ws://localhost:4444"
  18.  
  19. # Web interface:
  20. https://pastebin.com/0Gd4a7H7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement