sje30 / ess-unigd

MIT License
12 stars 0 forks source link

Get web sockets working #1

Closed sje30 closed 5 months ago

sje30 commented 5 months ago

I think I now have the basics of web sockets working...

(use-package websocket)

(setq my-websocket
      (websocket-open "ws://127.0.0.1:5900"
                      :on-message #'process-message
                      :on-close (lambda (_websocket) (message "sje websocket closed"))))

(defun process-message (_websocket frame)
  "Handle the message returing from the frame."
  (message "ws frame: %S" (websocket-frame-text frame))
  (shell-command "curl -s http://127.0.0.1:5900/plot > /tmp/o.svg")
  )