简体   繁体   中英

socket.io does not run on Mac as expected

I am using this tutorial series to make a chat messenger using socket.io, nodeJS and Mongodb on Mac OSX. according to the tutorial when we run server.js socket.io must start working but when I run the command:

node server.js 

the terminal shows nothing: Terminal

server.js:

var mongo = require('mongodb').MongoClient,
client = require('socket.io').listen(3000).sockets;

The default configuration of socket.io does not show anything on the debug console when you start it up. It used to be (in older versions of socket.io) that the default configuration would show some startup messages, but that is no longer the case (I'm guessing that's what your tutorial shows).

So, I'd suggest you verify that the socket.io server is actually running by either connecting to it or by looking at the open sockets for your node.js process to see it listening.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM