Try to run the chat example on the website socket.io.
server.js:
var express = require('express');
var app = express();
var server = app.listen(3000);
var io = require('socket.io')(server);
io.on('connection', function(socket){
socket.emit('an event sent to all connected clients');
console.log('a user connected');
socket.on('disconnect', function(){
console.log('user disconnected');
});
socket.on('chat message', function(msg){
io.emit('chat message', msg);
console.log('message:' + msg);
});
});
start:
node server.js &
netstat-lnp -t
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 9429/node
as far as I know - everything is normal, 3000 the port is listening.
try from a browser:
mydomen.com:3000
not loaded.
on the host - Service: Virtual server / OpenVZ
Where that not so?
launch the browser mydomen.com:3000 - not working(((
can server what's wrong?
prompt please to the beginner - Letitia_Okuneva commented on July 9th 19 at 13:36