javascript - socket.emit not passing messages -
i have following js code `var express = require('express'); var app = express(); var http = require('http').server(app); var path = require("path"); var io = require('socket.io')(http); app.get('*', function (req, res){ res.sendfile(path.join(__dirname, '/public')); }); app.use('/home',express.static(path.join(__dirname,'/public'))); //app.use('/static', express.static(__dirname + 'index.html')); io.on('connection', function (socket) { socket.on('message', function (data) { socket.emit('news', { hello: 'world' }); }); socket.on('another-message', function (data) { socket.emit('not-news', { hello: 'world' }); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); });` i have html code <html> <h1>working</h1> <script src="/socket.io/socket.io.js"...