Installation of the software

WARNING

Do not run the huscript-server on a machine and port that is accessible from the outside. Do not run it as root. This prove of concept version serves to demonstrate that it is possible to remotely run huscript commands. The software is not secure.

Installation of the server

Download the file huscript-tcl-server.zip. Copy it to a machine on which huscript is installed. Unzip archive file in a directory. As a user with appropriate access rights start the server from the directory with the command huscript -noTk server.tcl [port] . Replace [port] by the port on which you want to communicate with the server. You should now be able to connect to the server via telnet and to execute huscript commands this way.

Installation of the proxy

The proxy allows to use a remote huscript session from a stateless ejb. It can run on the huscript server or on another machine. Donwload mri-base-lib, mri-util-lib and SIJAME from http://dev.mri.cnrs.fr/projects/list_files/mrilibrary and put them into a folder. Download RemoteHuygens from http://dev.mri.cnrs.fr/projects/list_files/remote-huygens and put it into the same folder. Using a terminal go into the folder and run java -cp .:* fr.cnrs.mri.rhuygens.HuygensProxy [proxy-port]. The proxy is now listening on the given port. It will forward incoming huscript commands to the server and port that is specified in the incoming message and send the result back to the client.

Using the client in your code

Your program can now use code like below to run huscript commands on the distant machine:

        HuygensClient client = new HuygensClient("localhost", 
                                                  Integer.toString(port), 
                                                  huscriptHost, 
                                                  Integer.toString(huscriptPort), "1");
        client.connect();
        String result = client.execute("set a 5");
        System.out.println(result);
        result = client.execute("set a [expr $a+2]");
        System.out.println(result);
        result = client.execute("set a");
        System.out.println(result);
        client.disconnect();

Note that there is no connection between the client and the proxy between consecutive execute commands.