home.social

Search

958 results for “real_jon_c”

  1. "While people may be talking about it now, the real challenge is to change our work structures so that it is much more difficult for bullies (sociopaths) to succeed."

    jarche.com/2012/09/first-we-sh

  2. Real Madrid made it seven home wins from seven this season with a 4-1 Champions League thrashing of RB Leipzig, extending their scoring run to 45 games.

    mondiaries.com/2026/10/ucl-rea

  3. Real Madrid slight favorites to edge RB Leipzig in a tight UCL clash; expect excitement at 21:00 CEST.

    Real Madrid 55.4%
    Draw 26.8%
    RasenBallsport Leipzig 17.8%

    #Football #Soccer #UEFAChampionsLeague #RMA #RBL #RMARBL

  4. Real Housewives of Bedrock -10 Days of Halloween

    📸 by scarlet.starling (@scarlet.starling) in Second Life

    avatarshot.com/shots/1370

    #AvatarShot #SecondLife #bedrock #funny #halloween #leopardprint #redhair

  5. Real Madrid : José Mourinho fait une annonce sur Vinicius Jr
    🗞️ Foot Mercato - 🕐 20/10 14:48
    À Madrid, Vinicius Junior ne met quasiment plus un pied devant l’autre, pendant que Yan Diomandé prend enfin ses marques et s’est montré décisif lors des deux derniers matchs de la Casa Blanca (2 buts, 1 passe décisive). De quoi lui permettre de doub... [602 chars]
    🔗 footmercato.net/a5290165686565

  6. Real Madrid manager Jose Mourinho to keenly study Barcelona vs PSG ahead of El Clasico

    According to a report from SPORT, it has come to light that Real Madrid manager Jose Mourinho will…
    #Spain #ES #Europe #Europa #EU #Madrid #Barcelona #barcelonanews #fcbarcelona #JoseMourinho #RealMadrid
    europesays.com/spain/103475/

  7. Real Madrid coach Jose Mourinho says Vinicius Junior will start on the left against RB Leipzig but warns his place is not guaranteed as €140m signing Yan Diomande shines.

    mondiaries.com/2026/10/jose-mo

  8. Real-time chat applications are a great way to understand how modern web applications communicate beyond traditional request-response cycles. From customer support tools to team collaboration platforms, messaging systems need to deliver messages quickly, maintain consistent state, and handle multiple users communicating simultaneously.

    React provides a flexible foundation for building interactive chat interfaces, while Node.js makes it possible to manage concurrent connections efficiently. When combined with Socket.IO, these technologies enable bidirectional communication between clients and servers without requiring users to refresh their browsers.

    In this article, we will build a practical real-time messaging foundation using React concepts, Node.js, Express, and Socket.IO. We will cover the message lifecycle, room-based communication, connection management, basic validation, and important considerations for taking a chat application into production.

    Designing a Real-Time Chat Application with React, Node.js, and Socket.IO


    A typical chat application consists of three main layers: the React frontend, the Node.js backend, and a communication layer that connects them. React manages the conversation interface, including the message list, text input, connection status, and user interactions. The backend validates incoming messages, determines which users should receive them, and broadcasts events to connected clients.

    Socket.IO is useful because it provides event-based communication, automatic reconnection attempts, and room-based messaging. Unlike ordinary HTTP requests, which typically finish after returning a response, a WebSocket connection can remain open so the server and client can exchange events in both directions. Socket.IO can also fall back to HTTP long-polling when WebSocket transport is unavailable, depending on configuration.

    The following example implements a runnable Node.js chat server with Express and Socket.IO. It supports joining a named room, broadcasting messages to other participants in that room, tracking connected users, validating message content, and logging each important step. The example uses in-memory state to keep the implementation approachable, so messages and room membership are not persistent across server restarts.

    On the React side, create a Socket.IO client and register event listeners inside a useEffect hook. Keep the socket lifecycle synchronized with the component lifecycle, remove listeners during cleanup, and use functional state updates when appending messages. In production, authenticate connections, authorize room membership, apply rate limits, validate payloads on the server, and store messages in a database when conversation history must survive restarts.

    const express = require("express");
    const http = require("http");
    const { Server } = require("socket.io");
    const { randomUUID } = require("crypto");

    // Step 1: Create the Express application and HTTP server.
    const app = express();
    const server = http.createServer(app);

    // Step 2: Configure Socket.IO for browser clients.
    const io = new Server(server, {
    cors: {
    origin: process.env.CLIENT_ORIGIN || "http://localhost:5173",
    methods: ["GET", "POST"]
    }
    });

    // Step 3: Keep lightweight connection metadata in memory.
    // Use a database or shared store for a production deployment.
    const connectedUsers = new Map();
    const MAX_MESSAGE_LENGTH = 1000;

    // Step 4: Add a simple health endpoint for monitoring.
    app.get("/health", (req, res) => {
    res.json({ status: "ok", connectedClients: io.engine.clientsCount });
    });

    // Step 5: Register handlers whenever a client connects.
    io.on("connection", (socket) => {
    console.log(`[CONNECT] Client connected: ${socket.id}`);

    // Each client must choose a display name before chatting.
    socket.on("join-room", ({ username, room } = {}) => {
    if (typeof username !== "string" || typeof room !== "string") {
    socket.emit("chat-error", { message: "Username and room are required." });
    return;
    }

    const cleanUsername = username.trim().slice(0, 30);
    const cleanRoom = room.trim().slice(0, 60);

    if (!cleanUsername || !cleanRoom) {
    socket.emit("chat-error", { message: "Username and room cannot be empty." });
    return;
    }

    // Leave the previous room when a client switches conversations.
    const previous = connectedUsers.get(socket.id);
    if (previous) {
    socket.leave(previous.room);
    socket.to(previous.room).emit("user-left", {
    username: previous.username
    });
    }

    // Socket.IO automatically keeps track of room membership.
    socket.join(cleanRoom);
    connectedUsers.set(socket.id, {
    username: cleanUsername,
    room: cleanRoom
    });

    console.log(`[ROOM] ${cleanUsername} joined ${cleanRoom}`);

    // Confirm the join only after the server has processed it.
    socket.emit("room-joined", {
    username: cleanUsername,
    room: cleanRoom
    });

    // Notify other participants without echoing to the joining client.
    socket.to(cleanRoom).emit("user-joined", {
    username: cleanUsername
    });
    });

    // Step 6: Validate and broadcast a new chat message.
    socket.on("send-message", (payload = {}) => {
    const user = connectedUsers.get(socket.id);

    if (!user) {
    socket.emit("chat-error", { message: "Join a room before sending messages." });
    return;
    }

    if (typeof payload.text !== "string") {
    socket.emit("chat-error", { message: "Message text must be a string." });
    return;
    }

    const text = payload.text.trim();

    if (!text || text.length > MAX_MESSAGE_LENGTH) {
    socket.emit("chat-error", {
    message: `Messages must contain 1 to ${MAX_MESSAGE_LENGTH} characters.`
    });
    return;
    }

    // Build a consistent server-controlled message object.
    const message = {
    id: randomUUID(),
    username: user.username,
    room: user.room,
    text,
    createdAt: new Date().toISOString()
    };

    console.log(`[MESSAGE] ${user.username} in ${user.room}: ${text}`);

    // Broadcast to everyone in the room, including the sender.
    // The sender therefore receives the same canonical message object.
    io.to(user.room).emit("new-message", message);
    });

    // Step 7: Clean up user metadata when a connection closes.
    socket.on("disconnect", (reason) => {
    const user = connectedUsers.get(socket.id);

    if (user) {
    socket.to(user.room).emit("user-left", {
    username: user.username
    });
    connectedUsers.delete(socket.id);
    console.log(`[DISCONNECT] ${user.username}: ${reason}`);
    } else {
    console.log(`[DISCONNECT] ${socket.id}: ${reason}`);
    }
    });
    });

    // Step 8: Start the server and report its address.
    const PORT = Number(process.env.PORT) || 3001;
    server.listen(PORT, () => {
    console.log(`[STARTUP] Chat server listening on port ${PORT}`);
    console.log(`[STARTUP] Health endpoint: http://localhost:${PORT}/health`);
    });

    Conclusion


    Building a real-time chat application is an excellent exercise in frontend state management, event-driven backend development, and network communication. React handles the interactive user experience, Node.js processes application events, and Socket.IO keeps connected clients synchronized without relying on continuous polling.

    The example provides a foundation for room-based conversations, but a production-ready system requires additional engineering. Add authenticated user identities, room-level authorization, persistent message storage, rate limiting, structured error handling, monitoring, and appropriate deployment configuration before exposing the application to real users.

    Start with a single conversation room, verify that messages reach all connected participants, and then introduce features such as typing indicators, unread counts, message history, and private conversations. Which feature would you implement first when extending this chat application?#javascript #react #ai #webdev #software #coding #development #engineering #inclusive #community
    Building Real-Time Chat Applications with React and Node.js

  9. Real-life Emmerdale couple revealed as stars have been ‘secretly dating’ after on-screen romance

    EMMERDALE stars Olivia Bromley and Ned Porteous have been secretly dating for months following their sizzling on-screen love…
    #London #Britain #UnitedKingdom #UK #GB #England #Headlines #News #Europe #EU #Bromley #Emmerdale #ITV #SunClub
    europesays.com/gbr/london/4175

  10. Zero debts; no one in reality has α legit reason to hate. Feel free to enlighten me otherwise. The legal grind is necessary to defend my rights as α plaintiff. #REAL #LegalTrillOG #Revolution @russellrope @ russellrope.com/real-legaltril 🔨👼🏻📜⚖️

  11. Real life isn’t linear. Habit Garden was designed to flex with you — gentler during burnout weeks, portable when you travel, paused when you need rest. No guilt, just growth.

    Which life situation tends to break your habits most often?

    #HabitBuilding #Habits #Productivity

  12. Real Users never use the Help key.

  13. Real Madrid TV after the refereeing controversy: we are playing in the corrupt “Barcelona-Tebas-Negreira” league

    Real Madrid’s television channel has launched a fresh attack on Liga president Javier Tebas and on Barcelona, following…
    #Spain #ES #Europe #Europa #EU #Madrid #A.Guler #Barcelona #LaLiga #RealBetis #RealBetisvsBarcelona #RealMadrid #RealMadridvsSevilla #Sevilla
    europesays.com/spain/102565/

  14. Real Madrid player ratings vs Sevilla: Kylian Mbappe stars as Arda Guler shines in comfortable victory

    T. Courtois – 6/10 The Belgian was largely a spectator for much of the evening, as Sevilla struggled…
    #Spain #ES #Europe #Europa #EU #Madrid #LaLiga #Playerratings #RealMadrid #RealMadridvsSevilla #Sevilla
    europesays.com/spain/102431/

  15. 𝗥𝗲𝗮𝗹 𝗠𝗮𝗱𝗿𝗶𝗱 𝘃𝗶𝗮 𝗳𝗿𝗮𝗮𝗶𝗲 𝘁𝗿𝗲𝗳𝗳𝗲𝗿𝘀 𝗚ü𝗹𝗲𝗿 𝗲𝗻 𝗠𝗯𝗮𝗽𝗽é 𝗹𝗮𝗻𝗴𝘀 𝗦𝗲𝘃𝗶𝗹𝗹𝗮

    Real Madrid heeft de laatste competitiewedstrijd voor de topper van volgende week tegen FC Barcelona gewonnen. Trainer José Mourinho zag zijn elftal in stadion Bernabéu Sevilla met 4-1 verslaan.

    rtl.nl/nieuws/sport/artikel/56

    #RealMadrid #Güler #Mbappé

  16. The real question behind data access laws: does exceptional access to encrypted data actually solve more crimes?

    In episode 455 of the Shared Security Podcast, we discuss Canada's Bill C-22, Bruce Schneier's argument that compelling access has not produced meaningful arrests, and why good old-fashioned police work often convicts without access to a device.

    Full episode: sharedsecurity.net/2026/10/19/

  17. The real reason why your #fuel is expensive creating a domino effect across the World's economy lie squarely at the feet of #Trump & #Israel - NEVER FORGET THIS - They attacked #Iran

    Americans must see this news everyday in all feeds
    All Voters need to see the truth then vote Democrat!

    Ship attack reports near Hormu...

  18. Vyhraje Real Madrid v letošní edici Ligy mistrů třetí zápas ze tří? V cestě mu tentokrát bude stát Lipsko. ⚪🏆

    Vidíme se ve 20:45 na Nova Sport 6 a Oneplay. 👋

    #NovaSport #UCL

    instagram.com/p/DewAAeAijI2

  19. Vyhraje Real Madrid v letošní edici Ligy mistrů třetí zápas ze tří? V cestě mu tentokrát bude stát Lipsko. ⚪🏆

    Vidíme se ve 20:45 na Nova Sport 6 a Oneplay. 👋

    #NovaSport | #UCL

Share on Mastodon

Enter the server where you have an account.