[deutsch]

Using Kontrast online and offline

Kontrast is a browser-based library, so anything related to an interactive visualization (the HTML page, the scripts, the data) somehow needs to be accessible within the browser. There are two ways this can be achieved: Browsers can lookup HTML, JavaScript and CSS files directly from the file system or by using the HTTP protocol.

Direct file lookup

You can open files from the file system by entering file:///C:/folder/file.html into the address bar. Another way is to directly open HTML files with a browser (right-click, Open with …).

There are some security restrictions when accessing files directly from the file system. Most importantly, you cannot use XMLHttpRequest to fetch external data resources. Depending on the browser, access to local worker scripts and to the microphone is also prohibited.

Serving files over HTTP

A more robust solution is to serve files via the HTTP protocol. For this, a HTTP server is required. Of course you can use one of the commonly used HTTP servers, such as Apache or nginx.

If you want to avoid to install and to manage such a software, you can use the program Kontrast HTTP server, which is distributed as part of the Kontrast standalone distribution.

The program Kontrast HTTP server is a light-weight HTTP server which serves files from a directory on your disk over HTTP to your browser. This program works standalone (no installation required) and you do not need any special knowledge about HTTP servers. By running Kontrast HTTP server in its default configuration, the files that Kontrast HTTP server exposes are only available to local users on your computer, not to any other users in the network. For more information, please consult the documentation of the Kontrast HTTP server.