Grokking Node.js
0% completed
Setting Up WebSocket Servers in Node.js
Three clients, ana, ben and cy, are connected to the server built in this lesson. Ana sends one message, and this is what each client prints:
ben got: hello from ana ana got: hello from ana cy got: hello from ana
One message in, three messages out, including one to ana herself. The server passes each message it receives to every connected client, which is called broadcasting, and it is the core of a chat room. This lesson builds that server with the ws package, then makes it survive bad input and notice clients that disappear without saying goodbye.
Installing ws
Node
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%