<commit_before># HTTP server in ROOT

The idea of THttpServer is to provide remote http access to running ROOT application and enable HTML/JavaScript user interface. Any registered object can be requested and displayed in the web browser. There are many benefits of such approach:

   * standard http interface to ROOT application
   * no any temporary ROOT files to access data
   * user interface running in all browsers

## Starting the HTTP server

To start the http server, at any time, create an instance of the [THttpServer](https://root.cern/root/html/THttpServer.html) class like:

```cpp
auto serv = new THttpServer("http:8080");
```

This will start a [civetweb](https://github.com/civetweb/civetweb)-based http server on the port 8080. Then one should be able to open the address `http://localhost:8080` in any modern browser (Firefox, Chrome, Opera, Safari, IE11) and browse objects created in application. By default, the server can access files, canvases, and histograms via the gROOT pointer. All those objects can be displayed with JSROOT graphics.

There is a [server snapshot](https://root.cern/js/latest/httpserver.C/?layout=simple&item=Canvases/c1) of running macro [tutorials/http/httpserver.C](https://github.com/root-project/root/blob/master/tutorials/http/httpserver.C) from ROOT tutorials.

One could specify several options when creating http server. They could be add as additional URL parameters to the constructor arguments like:

```cpp
auto serv = new THttpServer("http:8080?loopback&thrds=2");
```

Following URL parameters are supported:

| Name                  |    Description    |
| :-------------------- | :---------------- |
| thrds=N               | number of threads used by the civetweb (default is 10) |
| top=name              | configure top name, visible in the web browser |
| auth_file=filename    | authentication file name, created with htdigets utility |
| auth_domain=domain    | authentication domain |
| loopback              | bind specified port to loopback 1172.16.17.32 address |
| debug                 | enable debug mode, server returns html page with request info |
| websocket_timeout=tm  | set web sockets timeout in seconds (default 300) |
| websocket_disable     | disable web sockets handling (default enabled) |
| cors=domain           | define value for CORS header "Access-Control-Allow-Origin" in server response |

If necessary, one could bind http server to specific IP address like:

```cpp
new THttpServer("http:192.168.1.17:8080")
```

One also can provide extra arguments for THttpServer itself:

| Name           |    Description    |
| :------------- | :---------------- |
| readonly, ro   | use server in read-only mode (default) |
| readwrite, rw  | use server in read-write mode |
| global         | let scan global directories for canvases and files (default) |
| noglobal       | disable scan of global directories |
| basic_sniffer  | use basic `TRootSniffer` without support of hist, gpad, graph, tree classes |

Example:

```cpp
new THttpServer("http:8080;ro;noglobal")
```<commit_msg>Add some more THttpServer args<commit_after># HTTP server in ROOT

The idea of THttpServer is to provide remote http access to running ROOT application and enable HTML/JavaScript user interface. Any registered object can be requested and displayed in the web browser. There are many benefits of such approach:

   * standard http interface to ROOT application
   * no any temporary ROOT files to access data
   * user interface running in all browsers

## Starting the HTTP server

To start the http server, at any time, create an instance of the [THttpServer](https://root.cern/root/html/THttpServer.html) class like:

```cpp
auto serv = new THttpServer("http:8080");
```

This will start a [civetweb](https://github.com/civetweb/civetweb)-based http server on the port 8080. Then one should be able to open the address `http://localhost:8080` in any modern browser (Firefox, Chrome, Opera, Safari, IE11) and browse objects created in application. By default, the server can access files, canvases, and histograms via the gROOT pointer. All those objects can be displayed with JSROOT graphics.

There is a [server snapshot](https://root.cern/js/latest/httpserver.C/?layout=simple&item=Canvases/c1) of running macro [tutorials/http/httpserver.C](https://github.com/root-project/root/blob/master/tutorials/http/httpserver.C) from ROOT tutorials.

One could specify several options when creating http server. They could be add as additional URL parameters to the constructor arguments like:

```cpp
auto serv = new THttpServer("http:8080?loopback&thrds=2");
```

Following URL parameters are supported:

| Name                  |    Description    |
| :-------------------- | :---------------- |
| thrds=N               | number of threads used by the civetweb (default is 10) |
| top=name              | configure top name, visible in the web browser |
| auth_file=filename    | authentication file name, created with htdigets utility |
| auth_domain=domain    | authentication domain |
| loopback              | bind specified port to loopback 127.0.0.1 address |
| debug                 | enable debug mode, server returns html page with request info |
| websocket_timeout=tm  | set web sockets timeout in seconds (default 300) |
| websocket_disable     | disable web sockets handling (default enabled) |
| cors=domain           | define value for CORS header "Access-Control-Allow-Origin" in server response |
| log=filename          | configure civetweb log file |
| max_age=value         | configures "Cache-Control: max_age=value" http header for all file-related requests, default 3600 |
| nocache               | try to fully disable cache control for file requests |
| winsymlinks=no        | do not resolve symbolic links on file system (Windows only), default true |
| dirlisting=no         | enable/disable directory listing for browsing filesystem (default no) |


If necessary, one could bind http server to specific IP address like:

```cpp
new THttpServer("http:192.168.1.17:8080")
```

One also can provide extra arguments for THttpServer itself:

| Name           |    Description    |
| :------------- | :---------------- |
| readonly, ro   | use server in read-only mode (default) |
| readwrite, rw  | use server in read-write mode |
| global         | let scan global directories for canvases and files (default) |
| noglobal       | disable scan of global directories |
| basic_sniffer  | use basic `TRootSniffer` without support of hist, gpad, graph, tree classes |

Example:

```cpp
new THttpServer("http:8080;ro;noglobal")
```
{'fraction_non_alphanumeric': 0.10146459308470482, 'fraction_numerical': 0.015702853691680507, 'mean_word_length': 3.401328903654485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '721437', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1720, 'n_words': 737}