Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Working with Web Sockets


HTTP was designed to be half-duplex, which means it allows transmission of data in just one direction at a time. This makes it unsuitable for building real-time applications that need an open, persistent connection always. To overcome this limitation of HTTP, developers have created some workarounds or hacks. Some of these workarounds are polling, long polling, and streaming.

Web Sockets provide an asynchronous, bidirectional, full-duplex messaging implementation over a single TCP connection. In this recipe, you will learn how you can use Socket.IO and Express to create a simple echo application. The application simply reverses the message and echoes it back to the user browser.

Getting ready

To complete this recipe, you will need the rhc command-line client installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for details. This application will consume one gear, so if you...