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

You are viewing a single comment. View All
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);