Secure, Reliable, Real-time Communication
v1.2.0Private Chat Protocol is a WebSocket-based communication system designed for secure and efficient real-time messaging. The protocol supports various message types, room-based communication, and user authentication mechanisms.
// Connect to WebSocket server
const ws = new WebSocket('ws://your-server/ws');
// Join a room
ws.send(JSON.stringify({
type: 'JOIN_ROOM',
roomId: 'room-123',
username: 'user123',
timestamp: Date.now()
}));
// Send a message
ws.send(JSON.stringify({
type: 'CHAT_MESSAGE',
roomId: 'room-123',
username: 'user123',
content: 'Hello world!',
timestamp: Date.now()
}));