Overview
About the app
A simple real-time chat app demonstrating the use of JavaScript server SDK provided by Azure Web PubSub
Azure Web PubSub enables
- Simple real-time chat between server and client
How it works?
Server side
Serve a static web page public/index.html A REST API /negotiate which returns a url to connect to Web PubSub- A simple Express server that serves a static web page
public/index.html - A REST API
/negotiatewhich returns a url to connect to Web PubSub - Listens for an
onConnectedevent to broadcast the joining of chat participants. - Listens for an
messageevent to broadcast a use's chat message to all participants in a hub.
Client side
- Using WebSocket API to initiate a WebSocket connection and listen for an
onmessageevent to render chat messages in the browser.