Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 788 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 788 Bytes

clojure-websocket

Clojars Project

A clojure wrapper for TooTallNate/Java-WebSocket which is 100% Jetty-free.

Usage

(def client (connect "wss://some-service/"
          :on-open    (fn [client handshake] (println "Open"))
          :on-message (fn [msg] (println (str "Message: " msg))
          :on-close   (fn [code reason by-server] (println (str "Closed: " code "," reason "," by-server)))
          :on-error   (fn [ex] (clojure.stacktrace/print-stack-trace ex)))))

(send-msg client "some-message")

License

Copyright © 2018 Alexander Eliseyev

Distributed under the Eclipse Public License, the same as Clojure.