Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 52 lines (30 sloc) 3.454 kb
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
1 # XMPP/HTTP PubSub Demo
1f3bf216 » whomwah
2010-11-23 add strophe demo
2
3 A simple demo of Publish/Subscribe in the browser using Strophe.js
4
0c931ecf » whomwah
2010-11-24 README changes for user accounts
5 This consists of a client.html and a publisher.html and a working XMPP setup (see below). You will be able to go to the publisher.html and send HTML and txt messages. Any number of people who have connected to client.html will recieved these messages and display them on their screen. This demo is not meant for production use, and serves to get people up and running with the technology as quickly as possible.
1f3bf216 » whomwah
2010-11-23 add strophe demo
6
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
7 ## Browser Support
1f3bf216 » whomwah
2010-11-23 add strophe demo
8
fe3f84ec » whomwah
2010-11-26 tweak README and test why my gravatar is not displaying correctly
9 You need a modern browser for the [CORS](http://www.w3.org/TR/cors/) support. This code has been tested in:
1f3bf216 » whomwah
2010-11-23 add strophe demo
10
11 * Google Chrome
12 * Safari 4+
13 * Firefox 3.5+
14
15 If you find it works in any other browsers, do let us know.
16
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
17 ## Strophe
1f3bf216 » whomwah
2010-11-23 add strophe demo
18
3ef354e3 » whomwah
2010-11-26 update to README
19 This demo uses the wonderful Strophe.js by [Jack Moffitt](http://metajack.im/) to do all the clever stuff.
1f3bf216 » whomwah
2010-11-23 add strophe demo
20
ca07edd2 » whomwah
2010-11-23 tweak readme
21 * [strophe.js](https://github.com/metajack/strophejs)
22 * [strophe.pubsub.js](https://github.com/metajack/strophejs)
1f3bf216 » whomwah
2010-11-23 add strophe demo
23
3ef354e3 » whomwah
2010-11-26 update to README
24 minimized versions of both are included, but for the latest versions and more information, visit the links above.
1f3bf216 » whomwah
2010-11-23 add strophe demo
25
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
26 ## Setting up an XMPP server
1f3bf216 » whomwah
2010-11-23 add strophe demo
27
d09c6729 » ramonrovirosa
2013-08-26 Update README.md
28 You'll need a running [XMPP server](http://xmpp.org/xmpp-software/servers/) and [BOSH connection manager](http://metajack.im/2008/09/08/which-bosh-server-do-you-need/). There are many options out there, but I've choosen to help you install [Ejabberd](http://www.ejabberd.im/), a popular XMPP server and latest versions (2.1.3+) comes with BOSH (Bidirectional-streams Over Synchronous HTTP) and CORS (Cross-Origin Resource Sharing) support baked in and enabled by default.
1f3bf216 » whomwah
2010-11-23 add strophe demo
29
3ef354e3 » whomwah
2010-11-26 update to README
30 I have added installation instructions for Ejabberd on Centos 5.5 in the /docs directory. If you have similar instructions for other setups, please send [pull requests](http://help.github.com/pull-requests/), and I'll try and feed these back.
1f3bf216 » whomwah
2010-11-23 add strophe demo
31
d09c6729 » ramonrovirosa
2013-08-26 Update README.md
32 Make sure to config Ejabberd to work with anonymous connections by modifying your ejabberd.cfg file by adding under the Authentication section this line:
33 ```{host_config, "vm.local", [{auth_method, [anonymous]},
34 {anonymous_protocol, both}]}. ```
35 (You'll then need to restart Ejabberd)
36
89ca52c9 » ramonrovirosa
2013-08-26 Update README.md
37 #####Note on Openfire#####
38 Openfire does not allow anonymous pubsub messaging.
39
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
40 ## Setting up the client and publisher
bf2701d1 » whomwah
2010-11-23 updtae README
41
3126b198 » whomwah
2010-11-24 update instructions
42 Once you have your XMPP server installed, you need to stick all the files above into a directory you can browse to in a web browser. You'll then need to update the configuration settings to reflect you XMPP server. It's also worth noting that all the files are currently grouped together, so if you are testing this on a public server, you'd want to stick all the publisher stuff behind some authentication, so anyone can't come along and start publishing stuff.
43
44 The files you'll need to update are:
45
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
46 * [js/shared.js](https://github.com/bbcrd/Strophejs-PubSub-Demo/blob/master/js/shared.js)
3126b198 » whomwah
2010-11-24 update instructions
47
48 This contains the BOSH_SERVICE and XMPP_SERVER locations. You will likely just have to change the domain. You can also change the PUBSUB_NODE. This is the common location that both publisher and clients go for messages. The dots just create a namespace. Always start the name with pubsub.
49
83dcd85b » whomwah
2011-11-14 Applied Apache 2.0 license
50 * [js/publisher.js](https://github.com/bbcrd/Strophejs-PubSub-Demo/blob/master/js/publisher.js)
3126b198 » whomwah
2010-11-24 update instructions
51
0c931ecf » whomwah
2010-11-24 README changes for user accounts
52 At the top of this page you set the account you will be logging in as, to publish the messages to all the connected clients. You can just use the admin account you created when setting up Ejabberd.
Something went wrong with that request. Please try again.