Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Websocket Essentials: Building apps with HTML5 websockets

You're reading from  Websocket Essentials: Building apps with HTML5 websockets

Product type Book
Published in May 2015
Publisher
ISBN-13 9781784396756
Pages 110 pages
Edition 1st Edition
Languages
Author (1):
Varun Chopra Varun Chopra
Profile icon Varun Chopra

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 library.

Now, to set up the server you must have Node.js installed on your machine. If you don't have it installed, then go ahead and check out the website of Node.js (https://nodejs.org/), read the documentation, and install it. Refer to the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}