This path allows you to integrate Insight Mobile with your system using WebSockets if you are running your apps as web apps on desktop, handheld devices, or even hybrid mobile apps.
You can run a WebSocket server inside Insight Mobile and other apps, either running on the same device or a local network (e.g. LAN, VPN). WebSocket supports two-way communication, so both the server and client can send and listen for messages/events.
Here, we have implemented the Streams API to define events and messages that can be exchanged between the customer's and ProGlove apps (i.e. WebSocket clients and Insight Mobile WebSocket server).
Devices and communication setup
The WebSocket server is running on localhost.
Select WebSocket integration path
- In Insight Webportal, under Device Visibility, select Configurations.
- At the top right, click the + icon to add a configuration.
- Select Insight Mobile (Android) and select Next.
- Under Connectivity Settings, select WebSocket.
- Enter the Port Number.
- At the bottom of the page, select Save.
A modal Assign a Name for the Configuration window displays.
- Type in the name of your configuration and select Next.
The modal Apply the Configuration window displays the Configuration Barcode.
- Scan the generated barcode with the scanner connected to Insight Mobile. The configuration is applied to the scanner and the Insight Mobile Android app.
- Select Save.
- Use the
ws://localhost:address followed by your Port Number (e.g.
ws://localhost:9998), to connect to the WebSocket server and communicate using Streams API messages.
Although ports can technically be integers lower than 1024, and port 80 is usually considered the default for WebSocket (ones that do note use SSL), a server running on ports lower than 1024 requires special root privileges on the running OS. As we cannot know the state of the customers' devices, we do not recommend using the WebSockets integration with ports lower than 1024. Additionally, as the TCP protocol does not allow port numbers 65536 and larger, the ports should be in the range of [1024,65536), or [2^10, 2^16).