Displaying items by tag: introduction
Sunday, 25 July 2010 19:31
JsRS is a light-weight scripting library framework that allowed you to build a live web application easily. You don’t have to create any database table for this framework. All you need to do is define what functions you wished to be call remotely and define the permission in the proxy file, and your application is ready to go!
While the diagram on the right is how JsRS works. The client will send a HTTP request to the server page which is the proxy. The proxy is a middleman between the client and the server. It will send the requested message to the server using specific port number (default is 38380). The HTTP request will be hold (wait) by the proxy until there is a new message coming from the server to this client. Once the proxy got a new message from the server, it will send it back to the client immediately.
socket.callCF(, "sendInstantMessage", ["Hi, my name is Kent."]);
The client’s ID is the ID that the client used to connect to the server. By default, the session ID will be used as the client’s ID.
Security might come into your concern when calling remote function. The Common Functions will store in a different context and is not stored in the global context. Meaning you don’t have to worry that other client are able to call the functions which is not part of the remote functions. For instance you have a function called “logout” which will destroy the user’s session and send the user back to the login page. Obviously you won’t put this as a remote function and causing the client being remote logout. Because the logout function was not defined in the remote function’s context, so this function will not be able to call remotely and your application is safe.
For more information, please read on the documentation.
Published in Version 1.0