GuidesWebsockets

Overview

The WebSocket protocol is a bidirectional communication session between a client and a server. You can send messages to the server and receive real-time, event-driven responses without having to poll the server for a reply.

The initial client request and server response use the HTTP protocol to establish the WebSocket communication. From then on, the client can subscribe to one or more topics (streaming channels) to stream data.

It is possible to use in very specific use cases, such as data visualization dashboards or maps that must reflect real-time data values, but also to receive responses for some commands sent to the network devices.

Examples

  • Populate a custom dashboard with the live status of Juniper Mist access points (APs) and real-time location data of Bluetooth Low Energy (BLE) assets.
  • Stream device data and statistics (such as transmit and receive packets) on an hourly basis to an external, operational dashboard like Grafana. Although the device statistics are robust, you can easily parse them to abstract the desired data for display.

WebSocket Streaming Channels

After Juniper Mist establishes a streaming connection with a client, the client needs to subscribe to at least one channel to send and receive messages. Messages go back and forth via the bidirectional WebSocket protocol. To stop sending and receiving messages from a channel, you can unsubscribe from it.

Authentication Options

Juniper Mist requires authentication to establish a connection to the WebSocket API, just like other API Calls. You can use these methods:

  • Creating API Tokens
  • HTTP login with Juniper Mist login credentials
  • API call to an external OAuth2 provider

On this page