JavaScript Tutorials
JavaScriptUsing UniversalComet for More Efficient Server Push
Comet is often touted as the next Ajax. It will still use JavaScript as its main programming language but could be a lot more when the application is properly developed. The buzz about Comet is not yet as intensive compared to Ajax but few developers are already making waves on their ability to build online applications based on Comet.
Basically Comet’s difference compared to other applications is based on the fact that data is streamed directly from the server side. It will use a highly efficient server push so that data will be stable and data streaming could be possibly faster.
If you are contemplating on developing Comet just to try your JavaScript or seriously contemplating in building a highly efficient online application, try the Comet-based library called UniversalComet. This JavaScript library will practically enhance the interaction of the online application since it will be utilizing server-push instead of client side streaming.
It could even be implemented in smaller Ajax based applications so that it could be transformed into an end point and data will be continuously streamed from the server. Since UniversalComet comes as a library, it will provide the basic tools needed to properly implement the application.
P2P – Like Behavior
UniversalComet’s efficiency is based on its efficient data streaming. Instead of opening the server to different users at one time, it will be using the “P2P-Like” behavior so that each user will have a unique connection to the server. At first glance it will look like a dragging option for developers since each user would have to be treated differently.
But upon closer look, you will notice that this behavior is actually implementing faster data streaming compared to client side interaction or by simply opening up the server. The data will be streaming through a simple HTTP-GET function which means it will not be using the standard XHR for Ajax or a specific GET command from the client side. The HTTP-GET simplifies everything – it will become a bridge for data from the server push to the client side.
Implementing URI
Aside from using HTTP-GET to follow the P2P like relationship of server and client side, it will be using URI or Uniform Resource Identifier to enhance the speed of the application. The URI will become part of the server as it will be provided to each client side who wants to access the server.
The URI will serve as an ID for each user – every user will have their respective URI which eases the streaming and accuracy of information. Developers would eventually experience increase of speed in developing and streaming their application.
Security Addressed
In using URI and HTTP-GET, the library is thought to be opening up a lot of security concerns. URI and HTTP-GET could be easily configured by attackers and data could be hijacked in the process.
To answer this concern, the library comes with specific parameters so that you will be able to protect your data from different attacks. Since data from the server and client is streamed in real time, parameters have to be set to ensure security.
Sponsored Links
