WebSocket
April 13, 2023 at 2:39 AMWebSocket
The SpringCard Companion Service exposes a WebSocket on port 3997 (this can be changed in the configuration).
This WebSocket provides is used to send event notifications to the listening applications regarding when devices are added or removed from the system. Also, it makes it possible to use the PC/SC middleware more completely, and more efficiently, than using the PC/SC REST API.
All the communication along the WebSocket uses JSON objects; whenever it is possible, the JSON RPC protocol is used.
Events
The WebSocket delivers push notifications when specific events occurs in the system or in the connected devices.
For instance, when the SpringCard Reader is configured for fast RFID inventory, the tag IDs or data collected from the RF field are pushed to the awaiting application(s) through this WebSocket.
PC/SC commands
The WebSocket also gives access to all PC/SC readers (not only SpringCard’s) that are attached to the computer, exposing the key PC/SC functions (SCardConnect, SCardTransmit, SCardDisconnect, and a few others) through the JSON RPC protocol.