TsgcWebSocketHTTPServerProperties › DocumentRoot

DocumentRoot Property

Directory served by the built-in HTTP server for static files (HTML, JavaScript, CSS, images, etc.).

Syntax

public string DocumentRoot { get; set; }

Default Value

(empty string)

Remarks

Set DocumentRoot to the local folder that holds the static assets the HTTP server is allowed to dispatch. When a client requests a document path, the server concatenates DocumentRoot with the request URI and, if the resulting file exists, returns it directly without firing the OnCommandGet event. Leave the property empty to disable automatic file dispatch so that every request is handled programmatically. Trailing slashes or backslashes are stripped automatically.

Example


oServer = new TsgcWebSocketHTTPServer();
oServer.Port = 80;
oServer.DocumentRoot = "c:\\www";
oServer.Active = true;

Back to Properties