IXWebSocket
IXWebSocket copied to clipboard
Configurable "doc root" for IXHttpServer
Currently when using IXHttpServer, static files are served from ".". This means static files have to be put into the same directory the server runs in. I think it is better practice to have a separate directory, such as "www" for the static files.
I propose a change to IXHttpServer, so that the line std::string path("." + uri);
can use a member variable instead of the ".". The simplest way is simply to add to the IXHttpServer class a new member variablestd::String docRoot;
. It would have default initialization to ".". I think simply public access would do, but need to review any security/extensibility concerns.
I'll open a PR after a short review by a committer.