How to start a chat (node.js, on the website?

Try to run the chat example on the website


var express = require('express');
var app = express();
var server = app.listen(3000);
var io = require('')(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);

node server.js &

netstat-lnp -t
tcp 0 0* LISTEN 9429/node

as far as I know - everything is normal, 3000 the port is listening.
try from a browser:
not loaded.
on the host - Service: Virtual server / OpenVZ
Where that not so?
July 9th 19 at 13:29
2 answers
July 9th 19 at 13:31
the problem was the server ordered the port in faerie.
July 9th 19 at 13:33
What do you expect to get? You are doing chat from exemple, why not use all what is written there?

Since you're not yet versed in what they are doing.
do everything as written, gradually understand. came to the first test - launched the server part,
launch the browser - not working(((
can server what's wrong?
prompt please to the beginner - Letitia_Okuneva commented on July 9th 19 at 13:36
You have nothing to boot, in your code, no html which need or can be given via the WEB. See the difference in your code. How did you decide that firewall ω in General is not clear. - Joshua97 commented on July 9th 19 at 13:39

Find more questions by tags