Replace Node.JS with Node.js

This commit is contained in:
Alexey Pyltsyn 2019-04-23 21:29:04 +03:00
parent b9ca311f19
commit 735880d45f
12 changed files with 17 additions and 17 deletions

View file

@ -274,7 +274,7 @@ To get connection state, additionally there's `socket.readyState` property with
## Chat example
Let's review a chat example using browser WebSocket API and Node.JS WebSocket module <https://github.com/websockets/ws>.
Let's review a chat example using browser WebSocket API and Node.js WebSocket module <https://github.com/websockets/ws>.
HTML: there's a `<form>` to send messages and a `<div>` for incoming messages:
@ -314,7 +314,7 @@ socket.onmessage = function(event) {
Server-side code is a little bit beyound our scope here. We're using browser WebSocket API, a server may have another library.
Still it can also be pretty simple. We'll use Node.JS with <https://github.com/websockets/ws> module for websockets.
Still it can also be pretty simple. We'll use Node.js with <https://github.com/websockets/ws> module for websockets.
The algorithm will be:
1. Create `clients = new Set()` -- a set of sockets.