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

Running server on mobile

Till now we were working on a local server and application, but to run the application on a mobile, we need to shift our client application code to a server in such a way that it will cater to the application from a server URL. For this we will take a simple example: basically, we are going to change an application we have already created. In Chapter 2, Getting Started with WebSockets, we developed an application for Echo test, which basically returns whatever we send to the server. Now let's see how it will work on a mobile phone.

Firstly, we will change the server code so that it caters to the client code. Here are the changes we will make on the server side:

var express = require('express'); var app = express() var http ...
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