O'Reilly logo

Socket.IO Cookbook by Tyson Cadenhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Securing Your Data

In this chapter, we will cover the following recipes:

  • Implementing basic authentication
  • Performing token-based authentication
  • Handling server-side validation
  • Locking down the HTTP referrer
  • Using secure WebSockets

Introduction

Although the WebSocket protocol provides several opportunities for more direct communication between the client and the server, people often wonder if Socket.IO is actually as secure as something similar to the HTTP protocol. The answer to this question is that it depends entirely on how you implement it. WebSockets can be easily controlled to prevent malicious or accidental security holes, but with any API interface, your security is only as tight as your weakest link.

In this chapter, we will explore ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required