Using Aleph (https://github.com/ztellman/aleph), you can create a
server that broadcasts messages from any client to all other clients
very easily:
(use 'aleph.http 'lamina.core)
(def broadcast-channel (permanent-channel))
(start-http-server
(fn [ch _]
(siphon broadcast-channel ch)
(siphon ch broadcast-channel))
{:port 8080, :websocket true})
You can then create a websocket client to send log messages:
(def client-channel @(websocket-client {:url "http://hostname:8080"}))
And then for each log message,
(enqueue client-channel log-message)
I'd be happy to answer any questions you have here or on the Aleph
mailing list.
Zach
On Feb 28, 3:21 am, MohanR <[email protected]> wrote:
> I refer this earlier
> threadhttps://groups.google.com/group/clojure/browse_thread/thread/f129d366...
>
> We are trying to develop a WebSocket server in Clojure that can
> broadcast Log4J messages to browsers. The Log4J code is Java and
> apart from writing files it will call the Clojure WebSocket server and
> post messages to the server. Any browser should be able to connect to
> this server and pick up the messages. It is a real-time update.
>
> It looks like I have to call one of the libraries mentioned in the
> thread to start a WebSocket server.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en