Back Midas Rome Roody Rootana
  Root Analyzer Framework, Page 4 of 4  Not logged in ELOG logo
ID Date Author Topic Subjectup
  8   03 May 2017 Thomas LindnerInfoweb display of MIDAS data using rootana+THttpServer
> 
> Hi Thomas,
> 
> > All details on setting up that example are here:
> > 
> > https://midas.triumf.ca/MidasWiki/index.php/Rootana_javascript_displays#Custom_web_display
> 
> I am trying to test the webdisplay but I am not sure which would be the path:
> 
> I start the  THttpServer with:
> 
> $ ana.exe -r9091
> 
> But on the url:
> 
> http://localhost:9091/
> 
> I find just the default browser provided by JSROOT, while nothing is found on:
> 
> http://localhost:9091/CS/webdisplay
> 
> Where am I supposed to find the custom webdisplay provided by you?

Hi Alberto,

I have added some additional details to the MediaWiki page that you referenced above.  The main point is as follows:

1) You need to setup a custom MIDAS webpage to point towards the example code in 
rootana/examples/html/generic_webdisplay.html
This means you need to add new entries to the ODB directory /Custom

2) The 'same-origin policy' means that you need to setup some sort of proxying so that the custom web page can access the 
ROOT webpage.  So, let's suppose in your case that you had the following ports for web servers:

ROOT webserver: localhost:9091
MIDAS webserver: localhost:8081

so in that case you would want to setup an APACHE proxy so that

localhost -> localhost:8081 (for the MIDAS server)
localhost/rootana -> localhost:9091 (for the ROOT server)

then the custom page would be available at

localhost/CS/webdisplay

Please read my updated documentation and see if this makes any more sense.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
  9   09 May 2017 Konstantin OlchanskiInfoweb display of MIDAS data using rootana+THttpServer
> 
> 2) The 'same-origin policy' means that you need to setup some sort of proxying so that the custom web page can access the 
> ROOT webpage.  So, let's suppose in your case that you had the following ports for web servers:
> [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
>

The MIDAS web server mhttpd already implements CORS, so you can access mhttpd AJAX and JSON-RPC from external web pages, no need to proxy.

Does the ROOT web server NOT implement CORS? We should file a bug report with ROOT if it does not.

K.O.
  20   10 Mar 2020 Konstantin OlchanskiInfoweb display of MIDAS data using rootana+THttpServer
> > 
> > 2) The 'same-origin policy' means ...
> > https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
> >
> 
> The MIDAS web server mhttpd already implements CORS, so you can access mhttpd AJAX and JSON-RPC from external web pages, no need to proxy.
> Does the ROOT web server NOT implement CORS? We should file a bug report with ROOT if it does not.

For the record, the web server in ROOT 6.20 does implement CORS via the "cors=" option, see
https://github.com/root-project/jsroot/blob/master/docs/HttpServer.md

K.O.
ELOG V3.1.4-2e1708b5