|View script||License||Download documentation as: HTML or editable|
|Download script||History||Other scripts by: coccinelle|
Script Library: 1213 scripts
Documentation for: easy-soccer.r
Welcome in the world of Easy-Soccer, a broker over Internet written in Rebol.
Author: Marco e-mail: email@example.com Date: July 10, 2004 Version: 1.0
1. Small introduction
2. On the side of the server
3. the client part
4. Mode of use
5. Compression and encryption
6. advanced Options
Easy-Soccer is a broker written in Rebol with the goal to facilitate the writing and the deployment of client/server application written in Rebol.
Easy-Soccer uses a simple server HTTP and cgi to execute Rebol code on a server. It also makes it possible to repatriate automatically on the client, the client part part of code.
Easy-Soccer makes it possible to very easily expose function written in Rebol like services. Thus, you can use its functions as if they were defined locally. Easy-Soccer uses HTTP for the transport of the messages like SOAP or X-RPC. If you can read a Web page while making
you can connect yourselves to services soccer.
To serve as the overall defined functions is really easy. Do simply this:
#! rebol -cs rebol [ ] do %easy-soccer.r serve [ now ]
To be able to use the distant services, it is simply necessary a do of the cgi server.
rebol [ ] do http://your.marvellous.server/your-script.cgi print now
This repatriates a stub of the functions 'now on the client and carries out it.
The function repatriated can be put in a context thus making it possible to use several server without conflict
rebol [ ] serveur1: context load do next load http://your.marvellous.server/your-script.cgi serveur2: context load do next load http://another.marvellous.server/another-script.cgi print [ "On server 1 it is" server1/now "whereas on server 2 it is" server2/now ]
It is not very beautyfull, but it works.
As indicated above, simple do HTTP:... or C %... then makes it possible to call upon the local or distant functions.
But easy-soccer allows much more than this and the mode of call is multiple. You find 2 samples below but there are other possibilities.
<OBJECT ID="rebol" CLASSID="CLSID:9DDFB297-9ED8-421d-Bï¿½C-37ï¿½0F36E6C5" CODEBASE="http://www.rebol.com/plugin/rebolb5.cab#Version=0,5,0,0 " WIDTH="800" HEIGHT="500 " > <PARAM NAME="LaunchURL" VALUE="your-script.cgi " > </OBJECT >
And in this case, if you open the file in the browser, the application is executed out in standalone,on the other hand if you open a URL then the application is executed as client/server.
Easy-soccer makes it possible to compress and to encrypt the data circulating on the network. For this, refinements /encrypt and /compress are at disposal
To compress :
serve/compress [ f1 f2 ] true; compress the data (default option) serve/compress [ f1 f2 ] false; do not compress the data
To encrypt :
serve/encloak [ f1 f2 ] true; encrypt the data serve/encloak [ f1 f2 ] false; do not encrypt the data (default option)
NB The encryption is weak because the key is transmitted with the data.
Easy-soccer makes it possible to "serve" as the functions which are executed localy or remotely according to mode of call of script.
But it is possible to "serve" any other type of data (datatype) except the port!In this case, the value is simply returned to the client.
For example, it is possible to return an object, but attention,if these objects contain functions they are executed locally, never remotely.