Share your repls and programming experiences

← Back to all posts
REAL TIME CHAT V1.1!!!!!
Duvangamer3845 (131)

HI EVERYONE!!!!

this update is the 1.1 to my chat web application, how works? witch socket.io and express,ok that dont matter

NEW FEATURES!!!!

its a small update so i cant give you to much, but this is the new features:

USERS

now if you enter your user, still in that place, you need to enter it in the left of the message box,

THE HTML CODE STILL :(

im sorry so much but im working in eliminate all the html code, because the time with the school works dont leave to much time, but im working and i know how to make it,please while i put the filter, dont use it, Thanks

NOW THE CONSOLE SHOE WHEN A USER DISCONNECT

cool, right?

TEMPORALY, THE CHAT IS CLOSED FOR MAINTENNANCE

NEWS:

The chat still closed because now the chat still without the html code filter and i working on that, but the usernames problem its solved

an hours more... to open agains the chat with the version 1.2

AND THANKS TO @DynamicSquid AND @potatojs TO TAKE THE TIME TO LOOK THIS LITTLE PROJECT

THE CHAT IS WROKING AGAIN, SEE THE FEATURES HERE: https://repl.it/talk/share/REAL-TIME-CHAT-V12/56431

Comments
hotnewtop
Duvangamer3845 (131)

@NoNameByProgram yes, work, but probably when you enter nothing its was connected

NoNameByProgram (198)

mate why do you comment it out
i wish there was a downvote button for some reason

Duvangamer3845 (131)

You see the last message Before the shutdown???

was: DIE RIDERS

OctagonalT (9)

aaand now people are abusing the html to redirect me to sign out of google.
FIX THE HTML PROBLEM MATE

OctagonalT (9)

and people are also impersonating me

OctagonalT (9)

okay so the people impersonating me actually was a bug in your code where it changes the nick of everyone in the chat room at the time

OctagonalT (9)

aaaaaand now the repl's off

Duvangamer3845 (131)

@OctagonalT thanks! upvote if you like, im waiting the 100 upvotes to launch the 1.4 with music and a small game

OctagonalT (9)

@Duvangamer3845 try making better css, purple and green dont appeal to me

AscherOppenheim (1)

var express = require('express');
var app = express();

var server = require('http').createServer(app);

app.get('/',function(req, res) {
res.sendFile(dirname + '/client/index.html');
});
app.use('/client',express.static(
dirname + '/client'));

console.log("Server started.");

SOCKET_LIST = {};

var io = require('socket.io')(server);
io.sockets.on('connection', function(socket){

    console.log('new user!');
    var socketId = Math.random();
    SOCKET_LIST[socketId] = socket;
          
    socket.on('sendMsgToServer',function(data){
    
        console.log('someone sent a message!');
        for(var i in SOCKET_LIST){
        SOCKET_LIST[i].emit('addToChat', data);
      
        }
      
    });

    socket.on('disconnect',function(){
        console.log('disconnected user :(')
        delete SOCKET_LIST[socket.id];

});

});

server.listen(4141);

DynamicSquid (4893)

This is awesome! Well done :)

Duvangamer3845 (131)

@DynamicSquid hey you can help me to make a html code filter in the chat, if i maked that, the trols cant enter html code and destroy the experience???

Duvangamer3845 (131)

@DynamicSquid if you dont want please tell me 'no' not leave me waiting please