bronson

0.5.0 • Public • Published

BRowser ONline SynchronizatiON Build status

Bronson is a real-time, cross-platform instant messaging framework for web, hybrid, and native mobile and desktop applications, built on top of Node.js and Socket.IO.

Functionality

Bronson shines in three dedicated areas:

  1. A wide array of supported platforms
  2. Isolated communication channels (rooms)
  3. Integration of existing backend APIs into the broadcasting platform.

More details below.

Supported platforms

Rooms

Clients can enter dedicated chat rooms to talk to other clients in that room. The visibility of broadcast messages is restricted to the room that the emitting client is in. Several rooms can be active at a time, allowing for parallel, isolated communication patterns.

Backend integration

Besides the traditional broadcast of static payload directly to peers, Bronson's broadcast messages can include a dynamic backend portion. In this scenario, the Bronson platform first performs a specified request to the backend API for the emitting client, then includes the backend's response into the message broadcasted to all clients.

Step 1 Clients load from the backend system and set up a persistent connection to the Bronson server.
Step 2 A client emits a broadcast message that includes a backend request to the Bronson server.
Step 3 The Bronson server forwards the request, including all request headers and cookies, to the backend system.
Step 4 The backend system responds to the Bronson server. No traffic to the clients happens at this stage.
Step 5 The Bronson server broadcasts the original broadcast message, including the response from the backend, to all clients.

This is useful, for example, to notify participants in a room about new data objects that have to be created on the server first. Bronson allows to do both things (creating objects in the backend and notifying all other clients) using only one call from the emitting device, thereby saving bandwidth and battery life on it.

How to use

Creating a Bronson server

Install the NPM module.

$ npm install bronson

Now, create a file called server.coffee, with this content:

Bronson = require 'bronson'
bronson = new Bronson "api.my-backend-host.com"
bronson.listen 3000

You can start this server like so:

$ coffee server.coffee

Chat server example.

More complete usage examples are given in the /examples directory.

The chat directory contains a fully functional chat application. The server portion, chat.coffee, creates a web server that serves an HTML file as well as a Bronson server for real-time broadcasting in only 12 lines of CoffeeScript. The client portion, chat.html, connects to the server, logs into a room, announces the user to the other participants, and provides facilities as well as UI for sending and receiving chat messages in only 10 lines of CoffeeScript.

Development

Fork away and send us a pull request!

Run the unit tests

$ npm test

You can alternatively run tests automatically with guard:

$ guard

Authors

Bronson is developed by Alex David and Kevin Goslar at Originate Inc., and is in production use for a variety of internal and external projects.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.5.03latest

Version History

VersionDownloads (Last 7 Days)Published
0.5.03
0.4.20
0.4.10
0.4.00
0.3.10
0.3.00
0.2.00
0.1.00
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i bronson

Weekly Downloads

3

Version

0.5.0

License

none

Last publish

Collaborators

  • hallettj
  • originate-owner