Introduction to Diffusion Real-Time Messaging through a simple application using Diffusion Cloud.
A set of simple projects, illustrating production and consumption of messages to and from a Diffusion Cloud instance.
These JavaScript code examples enable users to interact in real-time across various rooms or topics. You can also use other programming languages from our SDKs, including iOS, Android, C, .NET, and more.
diffusion-msg-app-L1 introduces the concept of Publish and Subscribe to 'Topics' (data structures). In Diffusion, data is stored and distributed through Topics.
diffusion-msg-app-L2 introduces the concept of Time Series topic to hold a sequence of events. Time series topics are useful for collaborative applications such as chat rooms. Multiple users can concurrently update a time series topic.
diffusion-msg-app-L3 introduces the concept of Security by requiring sessions to authenticate and use role-based authorization to define the actions that a client can perform.
- Download our code examples or clone them to your local environment:
git clone https://github.com/pushtechnology/tutorials/
- A Diffusion service (Cloud or On-Premise), version 6.5.0 or greater. Create a service here.
- Follow our Quick Start Guide and get your service up in a minute!
Make sure to add Diffusion library to your code. For JavaScript, we have added the following line in our public/chat.html
:
<script src='https://download.pushtechnology.com/clients/6.5.1/js/diffusion-6.5.1.js'></script>
Update public/js/app.js
to the hostname of your Diffusion Cloud service, which you can find in your service dashboard.
You can also leave the default values and connect to our sandbox service:
* host: 'diffusionchatapp.eu.diffusion.cloud'
* user: 'user'
* password: 'password'