웹개발/Node js1 Node js Socket IO 예제 Node js Socket IO 예제 var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var userList = []; var typingUsers = {}; app.get('/', function(req, res){ res.send('AppCoda - SocketChat Server'); }); http.listen(3000, function(){ console.log('Listening on *:3000'); }); //소켓 연결 완료 io.on('connection', function(clientSocket){ console.log('a user conn.. 2021. 3. 31. 이전 1 다음