WebSocket Server Applications



Now that you know how to use WebSockets on the client, it’s time to learn how to use WebSockets on the server. To enable support for WebSockets on the server, you’ll use the ws npm package, a WebSocket server implementation for use with Node.js applications.

The ws package provides both a server and a client implementation. The client implementation is only intended for use on Node.js, to enable server to server WebSocket connections. When reading the documentation for the ws package, focus on the following server examples:

After reading the documentation for the ws package, you should be able to: