WebServer

Options

  •  

Help

FFOS WebServer

This WebServer serves static files from your local storage devices (SDCards). Since it uses TCP Sockets you can address local HTML Files from your mobile browser by the HTTP protocol (e.g. http://localhost:8080/sdcard/test.html, provided there is an HTML file test.html on your SDCard and you have started the WebServer on port 8080). This even works offline, because both, the WebServer and the browser are running on the same device. Only the HTTP method GET is implemented and the local files will be accessed readonly. CSS and Javascript files are loaded as well and will be executed on your local browser. However if your device is connected to a network, other devices may also access your web content.

You also can access web resources within a zip archive. Important: The zip archive needs to have the extension .zip. All pathes within the archive can be accessed by URL: e.g. http://localhost:8080/sdcard/test.zip/folderWithinArchive/test.html

The main page

On the main page you will see the WebServer log output. The log level can be adjusted (see options). The number of displayed messages are limited to 2000 entries.

The Toolbar

At the bottom in the footer are five action buttons

  1. [?] Displays this help
  2. [] Opens the local browser with a welcome page (http://localhost:8080/)
  3. [] Clears the log view
  4. [] Starts or stops the WebServer

The Options Page

Opening the options page (action button [] in the header of the main page) to manage the WebServer options. All options will be saved in the local storage of the browser. So after a restart, the previous set options will be restored.

Following options are available

  1. Port - The port to listen for HTTP request. The application default value is 8080 since there may be security restrictions using the default web port 80
  2. Document Root - The base directory from where to serve the files. If you use the default (/) the whole local storage devices can be accessed. For security reasons you may wish to create a folder on your SDCard e.g. /sdcard/htdocs and to set the document root to this value. Only files within this folder (including subfolders) can be accessed. The document root is transparent to the user. The file /sdcard/htdocs/test.html can be accessed by the URL http://localhost:8080/test.html
  3. Log Level - There are four log levels:
    1. Debug - Lowest log level. Debug Informations will be shown in the log view.
    2. Info - Informational logs like server running state
    3. Warn - Errors that occur during client request, e.g. File Not Found
    4. Error - Highest log level. Unexpected errors that may be critical
    Once you have selected a log level, all messages from that type and those with a higher log level will be displayed. Messages with a lower log level will be suppressed.
  4. Binary Type - Internal type of message content. The string type seems to work on most devices. However, if there are problems with binary content try to use arraybuffer instead.
  5. Persistent Connection - If there are problems with hanging connections try to disable persistent connections.
Options can be changed at any time. Changes on options other than Log Level will have no effect on a running server and will be applied on a server restart.