In this chapter, we are going to build a chat application that is hauntingly reminiscent of the one that we saw in Chapter 5, Real-Time Data and WebSockets. The big difference, of course, is that our client will be an Ionic app this time, which will be able to interact fully with browser clients that are also connected to the same server. In doing so, we demonstrate how easy it is to build apps that almost seamlessly interact with apps on other platforms that use the same server.
To get our app working, we will need:
In the spirit of this book, we will of course use Node.js for our server. To add WebSocket support to it, we will use the socket.io
library, which you already saw in Chapter 6, Introducing Ionic.
For the client, we will use the standard socket.io
client library, which was seen in Chapter 5, Real-Time Data and WebSockets, (observed a trend here?). However, we will make some clever use of it in order to make things work smoothly on the app side of things.
Let's go ahead and start setting things up!
18.220.88.62