Hello everyone,

Experimental support for WebSockets in Ring was added in 1.11.0-alpha1. I 
haven't seen examples in the wild yet, so here is mine: a fully fleshed 
example that shows how to piece everything together.

https://github.com/danielsz/ring-websockets-meyvn

Two points of interest:


   - Browsers don’t expose the Ping and Pong API defined in the WebSocket 
   protocol. Web devs have to roll their own keepalive mechanism in the 
   application layer. This example shows one possibility (sweet and short) of 
   how to do that.


   - With Transit, Clojure data structures, instead of mere bytes or 
   strings, can be exchanged on the socket. This opens the door for routing 
   messages based on keys in maps, etc. Powerful stuff!


Special thanks to James Reeves (ring-websocket-transit 
<https://github.com/ring-clojure/ring-websocket-transit>) and Ning Sun (rj9a 
<https://github.com/sunng87/ring-jetty9-adapter>).

I should note that the example is for exploratory use. In production, use 
Sente <https://github.com/taoensso/sente>.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/332dcac6-7c95-4c34-b205-ff3937f39402n%40googlegroups.com.

Reply via email to