Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

yawc (yet another websocket client) https://travis-ci.org/niklasfasching/yawc.svg?branch=master

A minimal (< 500 SLOC) websocket client in clojure - without any dependencies.

Passes the autobahn websockets testsuite (see results).

Usage

(require '[yawc.core :as yawc])
(let [client (yawc/open
              {:host "echo.websocket.org"
               :port 80
               :path "/"
               :cb (fn [type payload client]
                     (cond
                       (#{:text :close :connect} type) (println type payload)
                       :else (println type (String. payload))))})]
;; => :connect {:status 101, :reason Web Socket Protocol Handshake, :headers {connection Upgrade, date Sun, 01 Apr 2018 13, sec-websocket-accept g7Uq6gHNVaVhx/pERAJiHxDSs/w=, server Kaazing Gateway, upgrade websocket}, :content }
(yawc/emit client {:opcode 1 :payload (.getBytes "Hello World!")}))
;; => :text Hello World!

Todo List

About

yet another websocket client

Topics

Resources

Releases

No releases published

Packages

No packages published