Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Readme.md

Streaming logs using json.webpubsub.azure.v1 subprotocol

Prerequisites

  1. Node.js
  2. Create an Azure Web PubSub resource

Setup

npm install

Start the server

Copy Connection String from Keys tab of the created Azure Web PubSub service, and replace the <connection-string> below with the value of your Connection String.

Connection String

Linux:

export WebPubSubConnectionString="<connection_string>"
node server

Windows:

SET WebPubSubConnectionString=<connection_string>
node server

The server is then started. Open http://localhost:8080/index.html in the browser. If you use F12 to view the Network you can see the WebSocket connection is established.

Start the log streamer

Run:

node stream

Start typing messages and you can see these messages are transferred to the browser in real-time.