Is there an option to customize rootbrowse?

Hello Expert,

Currently, I am using root_v6.32.06.Linux-almalinux9.4-x86_64-gcc11.4.tar.gz running on Almalinux 9.4. When I use

rootbrowse file.root

it opens the old version of TBrowse. However, on another machine (v6-26-10 ubuntu 22.04.2), the same command opens the new web-based browser. The .rootrc file is not configured on either of these two machines.

My question is, is there a way to configure rootbrowse to default to the web-based browser, specify the port number, and listen on 0.0.0.0?

Additional information: I can now start the web-based Browser interactively with the following:

$ root --web=server:$port file.root
root [0] auto browser = new ROOT::RBrowser();
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:$port
New web window: http://localhost:$port/win1/?key=......
root [1]

However, what I want is a non-interactive way that listens on 0.0.0.0:$port.

ROOT Version: 6.32/06
Platform: Almalinux 9.4
Compiler: pre-compiled binary

Regards,
Xiao

Hi Xiao and welcome on the forum,

Seems to be rootbrowse not correctly works with web-based TBrowser.
The only way to use it now - disable web mode providing rootbrowse -w flag.
I will try to fix it later.

By default server always bound to loopback address - because of security reasons.
If you want to use ROOT web widgets on remote host I recommend to use rootssh utility -
see some details here.

Only if sure that nobody else will access your http server from local network,
you can configure following:

root [0] ROOT::RWebWindowsManager::SetLoopbackMode(false);
root [1] gROOT->SetWebDisplay("server:7788");
root [2] new TBrowser

In printout you will get URL like http://localhost:7788/win1/?key=...,
but real host name can be used as well.

Regards,
Sergey

Hi Sergey,
Thank you for your quick response. Your method meets my needs, and I will be mindful of the risks of exposing the port.

Additionally, I have another question. I noticed that the old version (v6-26-10 on Ubuntu 22.04.2) only required access to http://localhost:$port/, while the new version’s address has changed to http://localhost:$port/win1/?key=....... It also seems that this link can only be accessed once. Is there an option to control whether a key is needed and whether the key can be accessed multiple times?

Regards,
Xiao

Key parameter was introduced intentionally - to provide reasonable security to web widgets.
Key is unique value and can be used only once.

For the web-based TBrowser only single connection is allowed. Therefore it is impossible to connect it without closing previous connection.

If connection closed, you can call br->Show() to get new URL. Like:

root [0] gROOT->SetWebDisplay("server:7788");
root [1] auto br = new TBrowser

ROOT comes with a web-based browser, which is now being started. 
Revert to TBrowser by setting "Browser.Name: TRootBrowser" in rootrc file or
by starting "root --web=off"
Find more info on https://root.cern/for_developers/root7/#rbrowser
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:7788
New web window: http://localhost:7788/win1/?key=54fc673b-e7b47299-c53d84c0-ea8348ae-f93a7060-f659acfb-e5ba6d02-ac0a7d17#fd0c24ad-56ce0151-e9752124-6da5ebbb-8703f8ef-af52d210-e1600381-73c48840
(TBrowser *) 0x19c05170
root [2] br->Show()
New web window: http://localhost:7788/win1/?key=f89f1bc9-e92b3586-6cce996d-bd1d1bf0-e87fcfe5-cda37acc-dbcc13ff-da780798#fd0c24ad-56ce0151-e9752124-6da5ebbb-8703f8ef-af52d210-e1600381-73c48840

I do not recommend (although it is possible) to disable keys usage required for HMAC-based authentication.

Regards,
Sergey

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.