Cross browser, bi-directional communication between ClojureScript and Clojure with BrowserChannel (Note: Originally a fork of https://github.com/kirasystems/clj-browserchannel)
This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2016-05-16 19:05:20 -04:00
chat-demo update dependencies 2016-05-16 18:56:33 -04:00
clj-browserchannel update READMEs 2016-05-16 18:56:52 -04:00
clj-browserchannel-immutant-adapter update READMEs 2016-05-16 18:56:52 -04:00
clj-browserchannel-jetty-adapter update READMEs 2016-05-16 18:56:52 -04:00
test Dusting off test 2013-07-31 21:36:34 +02:00
.gitignore add trace log output to clj-browserchannel 2016-05-13 12:39:13 -04:00
README.md more README updates 2016-05-16 19:05:20 -04:00

clj-browserchannel

Cross-browser compatible, real-time, bi-directional communication between ClojureScript and Clojure using Google Closure BrowserChannel.

From the Google Closure API:

A BrowserChannel simulates a bidirectional socket over HTTP. It is the basis of the Gmail Chat IM connections to the server.

The JavaScript API of BrowserChannel is open-source and part of the Google Closure library. The server component is not, as is noted in the Google Closure book ("Closure: The Definitive Guide by Michael Bolin").

Usage

This project is comprised of multiple libraries. You'll need to include two of them in your projects.

clj-browserchannel is the main library containing both the server- and client-side functionality you'll use in your web apps.

In order to use the server implementation of BrowserChannel you'll need to use one of the async adapters. Currently the provided options are:

You can find more information on usage of all of these components by following any of the above links to them.

Demo

The chat-demo application is an example chat application using a client-side and server-side implementation for BrowserChannel written in Clojure/ClojureScript. The server component is for BrowserChannel version 8. The client component serves as a wrapper over goog.net.BrowserChannel which also currently implements version 8 of the protocol.

The chat-demo web app runs in at least:

  • Chrome
  • Firefox
  • Internet Explorer 5.5+ (!!)
  • Android browser
  • Others
  • Websockets - Websockets solve the same problems as BrowserChannel, however BrowserChannel works on almost all existing clients. Websockets ultimately replaces BrowserChannel.
  • socket.io - socket.io provides a similar api as BrowserChannel on top of many transport protocols, including websockets. BrowserChannel only has two transport protocols: XHR and forever frames (for IE) in streaming and non-streaming mode.

Other BrowserChannel implementations

Many thanks to these authors, their work is the only open-source documentation on the BrowserChannel protocol.

About

Written by: Gijs Stuurman / @thegeez / Blog / GitHub

Many updates in this fork by: Gered King / @geredking / GitHub

License

Copyright (c) 2012 Gijs Stuurman and released under an MIT license.