Note: This document is updated due to 3.1 Jelastic version.
WebSockets is a prominent web-technology, that ensures establishing of a continuous full-duplex connection between client and server for the bi-directional messages to be instantly transmitted with little overhead. Communication over this TCP-based protocol results in a very low connection latency and rapid interaction, thus making your applications faster and more efficient.You can achieve the following benefits using WebSockets:
- Reduction of response delays and unnecessary network traffic consumption due to the full-duplex distribution through a single connection
- Streaming through proxies and firewalls, both upstream and downstream at once
- Backward compatibility with the pre-WebSocket world, by switching from the HTTP connection to WebSockets
Jelastic provides you with an advanced and complemented WebSockets support by means of integrating this technology to the Jelastic Shared Resolver and NGINX-balancer node, so you can use it even without external IP address attached to your app server.
The easiest way to activate the WebSockets support is to place an NGINX balancer in front of your application, making it the entry point of the environment and getting rid of any additional configurations. Over and above, this server can also be used for easily overriding the default settings with your custom ones, e.g. changing the listeners’ port numbers.Nevertheless, the WebSockets technology is also supported by the application servers provided at Jelastic - the appropriate configuration examples are available within our documentation:
And the guide below will provide insights on how to configure WebSockets support for your application, hosted at Jelastic Cloud, with the help of the NGINX-balancer node. As an example, we’ll use a simple chat application, written in PHP. So, let’s get started and move step-by-step from the very beginning.