Basic Chat Demo implements an extremely simple chat application
HTML CSS JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit dc6c2be Mar 23, 2017
Failed to load latest commit information.
src Add flush message. Apr 8, 2016
.gitattributes First Commit Jun 14, 2013
.gitignore First Commit Jun 14, 2013
LICENSE First Commit Jun 14, 2013 Fix markup formatting Mar 23, 2017
screen_chat.png Add screen_char picture Oct 1, 2013
screen_chat_large.png Add a shadow as image border Jul 2, 2014

Lightstreamer - Basic Chat Demo - HTML Client

The Lightstreamer Basic Chat Demo is a very simple chat application based on Lightstreamer.

This project includes a simple web client front-end example for the Lightstreamer - Basic Chat Demo - Java Adapter.

Live Demo


View live demo


This Basic Chat Demo implements an extremely simple chat application, where all the users connected to the page can exchange messages. Each message reports the originating IP address, together with the user-agent string of the originating client, instead of leveraging a nickname. Launch multiple instances of the demo, possibly on different machines, to appreciate the message broadcast capability. The front-end code can be considered a reference example of item subscriptions in DISTINCT mode.

Note: When you publish a value, your IP address is publicly displayed.

The demo includes the following client-side functionalities:


If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:

  • As prerequisite, the Basic Chat Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
  • Download this project.
  • Get the lightstreamer.js file from the latest Lightstreamer distribution and put it in the src/js folder. Alternatively, you can build a lightstreamer.js file from the online generator. In that case, be sure to include the LightstreamerClient, Subscription, DynaGrid, ConnectionSharing, and StatusWidget modules and to use the "Use AMD" version.
  • Get the require.js file form and put it in the src/js folder.
  • Deploy this demo on the Lightstreamer Server (used as Web server) or in any external Web Server. If you choose the former, please note that in the <LS_HOME>/pages/demos/ folder, there may be already a ChatDemo folder. If this is not your case, please create the folders <LS_HOME>/pages/demos/ChatDemo and copy here the contents of the /src folder of this project. The client demo configuration assumes that Lightstreamer Server, Lightstreamer Adapters, and this client are launched on the same machine. If you need to target a different Lightstreamer server, please search in js/lsClient.js this line:
    var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"CHAT");
    and change it accordingly.
  • Open your browser and point it to: http://localhost:8080/demos/ChatDemo/

See Also

Lightstreamer Adapters Needed by This Client

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.0 or newer.