Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Lightstreamer - Basic Messenger Demo - HTML Client

The Basic Messenger Demo is a very simple instant messenger application based on Lightstreamer for its real-time communication needs.

This project includes a simple web client front-end for the Basic Messenger Demo.

As an example of Lightstreamer Adapters Needed by This Client, you may refer to the Lightstreamer - Basic Messenger Demo - Java Adapter.

Live Demo


View live demo


The Basic Instant Messenger Demo shows an extremely simple version of a typical messenger, where messages can be delivered to a specific friend, chosen from a dynamic list of online buddies.

Choose a nickname and click Login. You will see a list of all users connected to this demo, with their nicknames. Write a message and choose a recipient. The message will be delivered only to him/her (rather than broadcasting it, as the Lightstreamer - Basic Chat Demo - HTML Client does).

Launch multiple instances of the demo, possibly on different machines, to populate the Buddies list. If you use the same nickname on different instances, you will actually embody the same identity (to keep things simple, no authentication is used).

The front-end code can be considered a reference example of one-to-one messaging. Each user subscribes to their personal item (corresponding to the nickname), so that messages can be routed properly, instead of begin broadcast (as in the Lightstreamer - Basic Chat Demo - HTML Client, where all the users subscribe to the same item). In real applications, where authentication is used, the Metadata Adapter should enforce the association between the user's identity and the item they have the right to subscribe to.

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 Lightstreamer - Basic Messenger 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.min.js file from npm or unpkg and put it in the src/js folder.
  • 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 MessengerDemo folder. If this is not your case, please create the folders <LS_HOME>/pages/MessengerDemo 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,"MESSENGER");
    and change it accordingly.
  • Open your browser and point it to: http://localhost:8080/MessengerDemo/

See Also

Lightstreamer Adapters Needed by This Client

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.0 or newer (installation instructions for version 8.0 or newer).


The Basic Instant Messenger Demo shows an extremely simple version of a typical messenger







No releases published


No packages published