This is my server.js:
var app = require('express')();
var server = require('http').Server(app).listen(8080,function(){
console.log('working');
});
var io = require('socket.io')(server);
app.get('/',function(req,res){
res.sendFile(__dirname+'/index.html');
});
io.on('connection',function(socket){
console.log('someone connected');
});
This is my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="node_modules/socket.io-client/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script>
var socket = io();
</script>
</body>
</html>
I think I did it correctly like in its site but when I run it on node and look at localhost:8080 I can't see 'someone connected' sentence in console.Where's the problem or what can be the problem?