Is it possible to configure THttpServer like apache2 to serve files located in the directory dir, so that the client loads css and img files, for example
Thanks, it works as you suggested. I append the example:
root [0]
Processing test.cxx...
Info in <THttpEngine::Create>: Starting HTTP server on port 8080
void test(int port=8080){
auto serv=new THttpServer(Form("http:%d",port));
serv->AddLocation("www/",".");
gSystem->Exec(Form("curl http://localhost:%d/www/%s.cxx",port,__func__));
cout << endl;
}
Should files served in this way be openable using TFile::Open() ?
When I try, I get errors like this:
root [0] auto inFile = TFile::Open("http://localhost:8080/currentdir/out.root");
Error in <TWebFile::GetLine>: error receiving data from host localhost
Error in <TWebFile::GetLine>: error receiving data from host localhost
Error in <TWebFile::GetFromWeb10>: error receiving expected amount of data (got 0, expected 4) from host localhost
I can open the file at the same URL using a web browser and wget.