[chimerax-users] Remote control?

Conrad Huang conrad at cgl.ucsf.edu
Mon Jul 24 15:29:02 PDT 2017


"remotecontrol" is actually an umbrella command that covers several 
mechanisms including ReST and XML-RPC.  Both PROTOCOLS support access 
from remote hosts; however, due to security concerns, the current 
implementations for both in ChimeraX only allow for connections from the 
local host.  To support access across a network, you will need to modify 
the Python code, taking care of the security trade-off for your 
environment along the way.  Even if you are willing to ignore the 
security issues for now, you still need to decide on how the different 
ChimeraX instances find each other.  You may well want to stop at this 
point :-), but nitty gritty details are below if you're comfortable with 
programming in Python.

The code for supporting ReST and XML-RPC are in "chimerax/rest_server" 
and "chimerax/remote_control" respectively in the Python "site-packages" 
directory.  Since I wrote rest_server, I can tell you more about that. 
In rest_server/server.py, there is a line:

     self.httpd = HTTPServer(("localhost", port), RESTHandler)

that creates a HTTP server within ChimeraX.  As you can see, it only 
accepts connections on host "localhost" on a particular port.  You can 
change that to, for example, ("", 65000) to allow connections on port 
65000 from any host.  How you propagate the host and port information 
among multiple ChimeraX instances is a hard problem for which we have no 
solution yet.  To invoke a command via ReST, you simply send a request 
to, for example, "http://hostname:65000/run?cmd=open+1gcn", where 
"open+1gcn" is the HTTP GET encoded string for the ChimeraX command 
"open 1gcn"; the output from the command is the returned text from the 
HTTP request.

You can see how the rest_server code currently works by running the 
ChimeraX command:

   remote rest start

You should see some output like:

   REST server started on host 127.0.0.1 port XXXX

in the Log panel.  You can then go to a web browser and visit:

   http://localhost:XXXX/cmdline.html

to display a ChimeraX command line in the browser window, where you can 
issue commands and see the output.

Hope this helps.

Conrad

On 7/24/2017 11:48 AM, Simon Smith wrote:
> I'm trying to find a way to mirror ChimeraX commands from one machine 
> onto several others running on a network. Could someone tell me if the 
> 'remotecontrol' command would be a good way to do this, and if so, how I 
> could get started using it? As far as I can tell there's no 
> documentation available for it yet.
> 
> Thanks,
> Simon
> 
> 
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users
> 


More information about the ChimeraX-users mailing list