Socketstream is an open-source web framework, powered by Node.js, which is mainly focused on building single-page real time applications and provides a set of tools for that. Its modular structure is designed not to bind you to a particular technology for being used within apps, but its main benefit is native WebSockets support. This framework supports all the modern browsers, allowing to establish a true bi-directional communication without any noticeable latency and makes your application actually work in real time!
Valuable features of Socketstream framework:
- Live Reload – automatically reloads the browser when clients` files change
- Comprehensive support for client-side templates
- True bi-directional communication using WebSockets
- Easy authentication
- Easy code-share between the client and server
So, let’s examine its functionality in more detail by deploying a simple Socketstream app inside the Jelastic Cloud.
Create an Environment
- First of all, you need to log into your Jelastic account and create a New environment – the appropriate button can be found in the top left corner of the opened dashboard.
- In the appeared environment wizard, switch to the Node.js tab at the top, where the required app server will be already chosen:
Thus, just define the resource limits using the cloudlet sliders in the central pane, make sure you switch on the Public IPv4 option (circled above) and enter the desired environment name (e.g. socketstream). Click Create to finish.
Now, let’s build and deploy the appropriate code to the prepared environment.
- Open the Socketstream project page at GitHub and click on the Copy to clipboard button at the pane to the right.
- Return to the Jelastic dashboard and click on the Add project icon for your Nodejs server.
- At the appeared Add project frame, ensure you have the Git tab opened and paste the URL you’ve just copied into the same-named field.
Adjust the rest of the non-obligatory options if needed and click the Add button below. Wait until your project is successfully deployed (this may take a couple of minutes).
Start the Application
Now it’s time to perform some configurations for making our Socketstream app work properly.
- Click the Config icon next to the Nodejs app server at your Jelastic dashboard.
- In the opened Сonfiguration manager tab, locate the package.json file within the webroot/ROOT directory and insert the following line into its scripts section (which starts approximately at the 77th line) as it is shown below:
“prestart”: “sudo npm install -g socketstream; socketstream new jelastic; cd jelastic; npm instal”,
- Save the changes and Restart node with the appropriate button next to your app server.
- Now, you need to change the package.json file one more time. Substitute the prestart line you’ve specified before with the next string:
“start”: “cd ~/ROOT/jelastic/ && node app.js”,
Save the made changes and Restart node once again.
- Finally, select the Open in browser icon for your environment.
The application will be opened within a new browser tab.
Congratulations! Now, you can use the Socketstream chat app to enjoy real time communication with advanced data security, great uptime and high availability.
Sign up for a 2-week-free-trial and try to deploy Socketstream application on your own.