websockets w/ clojure

458 views
Skip to first unread message

Sean Allen

unread,
Dec 24, 2010, 11:58:03 AM12/24/10
to clo...@googlegroups.com
We did a prototype application using websockets for work using node.js as the server.
Websocket client connects, sending some basic info... said info is used to repeatedly get
new data from a database that is pushed down as it arrives in the db to the client which displays.
There will be more than 1 client, each with its own data constraints that are used to get the data 
to send.

If it goes into production we need to run on the jvm so I've been rewriting in clojure. I spent a couple
hours yesterday trying to figuring out the best websockets option to use w/ the clojure based server
before I gave up. I realized w/o any background I'm just running blind.

Given the basic idea of the application, what is the best websockets abstraction to use w/ clojure?
Aleph? The jetty websocket support? Something else? 

Pointers from anyone will more experience doing a websocket server in clojure greatly appreciated.

Thanks,
Sean

paul santa clara

unread,
Dec 24, 2010, 1:55:58 PM12/24/10
to clo...@googlegroups.com
I have had a lot of success with Aleph.  Just remember to clone the git repo as things move quickly and the clojars version is often out of date.  Also, I would recommend taking the time to read over lamina wiki's as Aleph utilizes their channel abstractions:


good luck,
-Paul SC


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Zach Tellman

unread,
Dec 24, 2010, 7:24:05 PM12/24/10
to Clojure
If you decide to try Aleph and have any questions, I'm available via
Github or on the mailing list at http://groups.google.com/group/aleph-lib.

Zach

On Dec 24, 10:55 am, paul santa clara <kesseri...@gmail.com> wrote:
> I have had a lot of success with Aleph.  Just remember to clone the git repo
> as things move quickly and the clojars version is often out of date.  Also,
> I would recommend taking the time to read over lamina wiki's as Aleph
> utilizes their channel abstractions:https://github.com/ztellman/lamina/wiki/Channels
>
> And of course:https://github.com/ztellman/aleph/wiki/HTTP
>
> good luck,
> -Paul SC
>
> > clojure+u...@googlegroups.com<clojure%2Bunsu...@googlegroups.com >

Jay Fields

unread,
Dec 24, 2010, 7:53:10 PM12/24/10
to clo...@googlegroups.com
I've written a few Clojure websocket apps and used Jetty. Things worked out fine and there wasn't much code at all to integrate. I'd recommend it. 

Sent from my iPhone
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com

Sean Allen

unread,
Dec 24, 2010, 11:58:54 PM12/24/10
to clo...@googlegroups.com
Jay,

Do you have any publicly released code I could take a look at?
I've only found a couple of jetty/clojure/websocket examples and would love
to have more I could study.

-Sean-

Jay Fields

unread,
Dec 26, 2010, 6:08:36 PM12/26/10
to clo...@googlegroups.com
I don't have any publicly available jetty/clojure/websocket code. I'll see if I can throw something together tomorrow.

Cheers, Jay

Stuart Sierra

unread,
Dec 29, 2010, 10:51:33 AM12/29/10
to clo...@googlegroups.com
Netty. Excellent library, great documentation, built-in websocket support.  http://www.jboss.org/netty

Example use from my work-in-progress, Cljque:

-Stuart Sierra

Nuno Marques

unread,
Dec 29, 2010, 11:11:08 AM12/29/10
to clo...@googlegroups.com
I'm not sure if people are aware or not but websockets have been dropped from firefox and opera and they expect other browsers to follow.

If you follow the links you can read the thread on the ietf mailing list where the paper authors, that expose a vulnerability when transparent proxies are involved, propose a different handshake for the protocol. 

--

Jay Fields

unread,
Mar 4, 2011, 1:49:24 PM3/4/11
to clo...@googlegroups.com
I finally got around to writing this:
http://blog.jayfields.com/2011/02/clojure-web-socket-introduction.html

Cheers, Jay

---------- Forwarded message ----------
From: Sean Allen <s...@monkeysnatchbanana.com>
Date: Dec 24 2010, 11:58 pm
Subject: websockets w/ clojure
To: Clojure


Jay,

Do you have any publicly released code I could take a look at?
I've only found a couple of jetty/clojure/websocket examples and would
love
to have more I could study.

-Sean-

On Fri, Dec 24, 2010 at 7:53 PM, Jay Fields <j...@jayfields.com>
wrote:
> I've written a few Clojure websocket apps and used Jetty. Things worked out
> fine and there wasn't much code at all to integrate. I'd recommend it.

> Sent from my iPhone

> On Dec 24, 2010, at 11:58 AM, Sean Allen <s...@monkeysnatchbanana.com>
> wrote:

> Thanks,
> Sean

> clojure+u...@googlegroups.com<clojure%2Bunsu...@googlegroups.com >

Sean Allen

unread,
Mar 5, 2011, 9:56:19 PM3/5/11
to clo...@googlegroups.com, Jay Fields
I'd missed that when it went up. Thanks for pinging the list on this.
Reply all
Reply to author
Forward
0 new messages