@openrfid/websocket
v1.0.0
Published
Real-time WebSocket broadcasting server plugin for OpenRFID Simulator.
Readme
@openrfid/websocket
Sub-10ms Real-Time WebSocket Tag Stream Broadcaster Plugin
🚀 Overview
@openrfid/websocket is the real-time streaming protocol plugin for OpenRFID Simulator. It creates a low-latency WebSocket server (ws://localhost:3101) that streams sub-10ms JSON tag detection events directly to web SPA consoles, mobile apps, or enterprise event monitoring dashboards.
Developed & Maintained by RFID Software India Private Limited.
📦 Installation
# npm
npm install @openrfid/websocket
# pnpm
pnpm add @openrfid/websocket💻 Code Example
1. Register WebSocket Broadcaster Plugin
import { SimulationEngine } from '@openrfid/simulator';
import { WebSocketPlugin } from '@openrfid/websocket';
const engine = new SimulationEngine();
// Instantiate WebSocket Broadcaster plugin on port 3101
const wsPlugin = new WebSocketPlugin({
port: 3101,
path: '/ws/tags'
});
await engine.pluginManager.registerPlugin(wsPlugin);
await engine.start();
console.log('WebSocket Broadcaster active on ws://localhost:3101/ws/tags');2. Connect from Client Browser
const socket = new WebSocket('ws://localhost:3101/ws/tags');
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Tag Detection Event:', data.epc, 'RSSI:', data.rssi);
};🌐 Monorepo Ecosystem
| Package | Description |
| :--- | :--- |
| @openrfid/plugin-api | Plugin lifecycle interfaces & sandbox manager |
| @openrfid/rest | Fastify REST API plugin |
| @openrfid/mqtt | MQTT IoT publisher plugin |
📄 License & Corporate Support
Licensed under the MIT License.
Brought to you by RFID Software India Private Limited.
For enterprise RFID middleware, hardware drivers, or custom protocol plugins, visit rfidsoftwares.com.
