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.
clj-browserchannel/chat-demo
Gered f889985fe1 update wrap-browserchannel arguments
passing in event handlers is obviously going to be the most common
usage (all apps won't necessarily need to change the default options,
though many will want to). so it seems silly to hide the event handlers
as an option... i feel like it's better as it's own separate
argument.
2016-05-15 22:16:06 -04:00
..
resources add trace log output to clj-browserchannel 2016-05-13 12:39:13 -04:00
src/chat_demo update wrap-browserchannel arguments 2016-05-15 22:16:06 -04:00
Procfile fix chat-demo 2016-05-07 16:20:54 -04:00
project.clj add response-timeout option to immutant adapter (same as jetty adapter) 2016-05-09 20:06:12 -04:00
README.md add immutant adapter support to the chat-demo 2016-05-07 16:58:36 -04:00

chat-demo for clj-browserchannel

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

See also: [clj-browserchannel][1] [1]:https://github.com/thegeez/clj-browserchannel

Demo

clj-browserchannel-demo is an example chat application using a server side implementation for BrowserChannel written in Clojure. The server component is for BrowserChannel version 8.

This enables client->server and server->client communication in ClojureScript and Closure web apps, without any javascript dependencies other than the Google Closure library.

The example runs in at least:

  • Chrome
  • Firefox
  • Internet Explorer 5.5+ (!!)
  • Android browser

Running

You can either start it up directly from a REPL by simply running:

(-main)

Or you can run it easily from a command line via the included Leiningen alias to build and run everything:

$ lein rundemo

Once the application server is running, you can then open up http://localhost:8080/ in your browser. Open it in multiple browser windows to see the chat communication in action.

At the bottom of the -main function in chat-demo.server, you can comment/uncomment out the different run- functions to choose which web server you want to test out the demo with.

About

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

Updated by: Gered King / @geredking / Github

License

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