Add README and initial project structure for WebSocket chat application
* Created README.md for project overview and setup instructions. * Updated App component to use selector for todo items. * Enhanced TodoItemComponent styling and structure. * Introduced new Redux selectors for better state management. * Added initial configuration files for RequireJS and Bun. * Established project structure for WebSocket chat application with server and frontend components. * Included necessary dependencies and configurations for TypeScript and Vite.
This commit is contained in:
@@ -9,11 +9,13 @@ export default class WebSocketServerFactory {
|
||||
const webSocketRelayServerOptions: WebSocketServerOptions = {
|
||||
onSocketError: (client, error) => logger.error(`Error: [%o] [${error.message}]`, client),
|
||||
onSocketOpen: client => {
|
||||
console.log('New WebSocketClient [%o]', client);
|
||||
logger.debug('New WebSocketClient [%o]', client);
|
||||
|
||||
clients.add(client);
|
||||
},
|
||||
onSocketMessage: (fromClient, message) => {
|
||||
console.log('Relaying message [%o]', message);
|
||||
logger.debug(`Relaying message [%o]`, message);
|
||||
|
||||
for (const client of clients) {
|
||||
@@ -24,7 +26,10 @@ export default class WebSocketServerFactory {
|
||||
client.send(message);
|
||||
}
|
||||
},
|
||||
onSocketClose: client => clients.delete(client),
|
||||
onSocketClose: client => {
|
||||
console.log('Client closed [%o]', client);
|
||||
clients.delete(client);
|
||||
},
|
||||
onSocketDrain: client => logger.debug('Client drain [%o]', client),
|
||||
publishToSelf: false
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user