WebSocket Framework is a lightweight JavaScript library for creating WebSocket servers in Node.js applications.
You can install the WebSocket Framework via npm:
npm install websocket-framework
const WebSocketFramework = require('websocket-framework');
// Initialize WebSocket server options
const options = { port: 8080 };
// Create a new WebSocketFramework instance
const wsf = new WebSocketFramework(options);
// Start the WebSocket server
wsf.start();
You can broadcast messages to all connected clients using the broadcast
method:
const message = 'Hello, world!';
wsf.broadcast(message);
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.