A simple WebSocket chat client for Node.js.
You can install this package via npm:
npm install simple-websocket-chat-client
const SimpleWebSocketChatClient = require('simple-websocket-chat-client');
// Create a new instance of the chat client
const chatClient = new SimpleWebSocketChatClient('ws://chat.example.com');
// Sending a message
chatClient.sendMessage('Hello, world!');
Creates a new instance of the WebSocket chat client.
-
serverAddress
(optional): The address of the WebSocket server to connect to. Defaults to'ws://localhost:8080'
.
Sends a message to the chat server.
-
text
: The text of the message to send.
This project is licensed under the MIT License - see the LICENSE file for details.