Skip to Main Content
Websocket Essentials: Building apps with HTML5 websockets
book

Websocket Essentials: Building apps with HTML5 websockets

by Varun Chopra
May 2015
Intermediate to advanced content levelIntermediate to advanced
110 pages
2h 7m
English
Packt Publishing
Content preview from Websocket Essentials: Building apps with HTML5 websockets

The WebSocket server

We have seen how the client works and how we can send the data to the server and receive it from server. Now we will see how we can make our own server code handle the messages.

Using modern web technology, we will explore the implementation of the WebSocket server using Node.js. Node.js is a very friendly, lightweight, and easy-to-use platform. So let's see how we can make our own WebSockets server.

The Node.js server

The Node.js server gives us a lot of flexibility to create our own server. There are many library packages available via NPM. We will be using a library created by Einar Otto Stangvik which basically handles general mechanisms, such as upgrading the HTTP protocol and others. It is a very robust, clean, and lightweight ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Definitive Guide to HTML5 WebSocket

The Definitive Guide to HTML5 WebSocket

Vanessa Wang, Frank Salim, Peter Moskovits

Publisher Resources

ISBN: 9781784396756Supplemental Content