- Node.js
- Create an Azure Web PubSub resource
npm installCopy 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.
Linux:
export WebPubSubConnectionString="<connection_string>"
node serverWindows:
SET WebPubSubConnectionString=<connection_string>
node serverThe 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.
Run:
node streamStart typing messages and you can see these messages are transferred to the browser in real-time.
