HomeVisionXL Web Server PluginThe Web Server plug-in provides the same functionality as the Web Server of the Windows HomeVision software with several additions:
Basic operationThe Web Server responds to incoming requests from web browsers. Such a request specifies a Universal Resource Identifier (URI) and possibly some additional post data generated from a HTML form. A URI consists of a number of distinctive parts:
http://localhost:11080/index.cgi?device=HomeVision#location
The different parts of this URI are:
The Web Server plug-in is only able to handle URIs for the HTTP and HTTPS mechanisms. The hostname has to refer to the machine the Web Server is running on. The port number can be configured on the Web Server configuration dialog. In addition to the standard tags that may be present in a HTML document, the Web Server plug-in will scan the document for special HV tags and substitute the appropriate text. For details, see the help pages for the web browser.
Dynamically generated resourcesThe plug-in recognizes a few file extensions that indicate the type of resource:
The executable generating the dynamic web pages may be written in a programming- or scripting language available on the machine that runs the Web Server. Examples: Batch files, sh script, tcl script, perl script, compiled C program, etc. The output of the program must start with one or more lines that complete the response header. In its simplest form this is just an empty line indicating the end of the response header. All other lines of the response header must contain an identifier, a colon and a value. Anything else will result in an error. Any CGI program running longer than 5 minutes is assumed to be stuck in a loop and will be killed. Dynamic content can also be generated via the <HV:Run> and <HV:Image> tags. Real-Time Updates via WebsocketsTraditional communication between a browser and a web server uses a request/response method. The browser makes a request, and the server responds to it. This method does not lend itself to server initiated updates. The HTML5 specification contains the concept of a websocket. Essentially, a websocket provides a two-way channel between a browser and a web server, allowing data to flow between the two at any time. The HomeVisionXL Web Server supports websockets.For real-time updates to work, the following is required:
Browser Support for Websockets As of the time version 7.0 of the Web Server plug-in was released, Firefox 9.x (PC and mobile versions) supports websockets and gradient buttons (as used for page, menu and action buttons). Websocket Enabled Built-in Web Pages For those browsers that also have support for websockets, the built-in web pages now use websockets to provide real-time updates of object status, without having to reload or click on the "Update" button.
Smartphone SupportA set of web files is available that make use of websockets to provide a set of real-time web pages suitable for a smartphone. These pages provide similar data as the normal PC-based built-in web pages but are formatted more for smartphones and tablets and make full use of the two-way websocket channel. When used with browsers that have websocket support, websockets provide a way for the server and the browser to pass data back and forth without having to reload the web page. This allows for an interaction with the HomeVision Controller that is more like a real-time application instead of a web browser session.Real-time updates can be available for the following object types: X-10, Custom Lights, Flags, Variables, Inputs, Outputs, Analog Inputs, Digital Temperature Sensors, Thermostats (HVAC), and Security. The Smartphone web files require HomeVisionXL 2.2 and Actions Plug-in version 1.x or later. Secure Connections via CertificatesThe Web Server provides a certificate-based, secure, encrypted connection. This type of connection provides two main benefits: an encrypted connection, and secure identification of users. All communications between the client and server is encrypted, and user names and passwords are not needed. You can set up your system to provide just an encrypted channel, where you still log in (although your password would now be encrypted), or an encrypted channel where you eliminate explicit logging in altogether.The non-secure user/password (HTTP) and the secure certificates (HTTPS) methods can be used simultaneously. Each potential user of the HomeVisionXL Web Server needs to be authenticated because you don't want just anyone to be able to control your house. The classic method is to use a username-password pair, but with a secure connection, the use of a client certificate by the browser serves this purpose. While the server identity is not as big a concern in this application, https doesn't support identifying only the client, so the server will need to be identified with a certificate as well. The Certificate Wizard provides a means to easily generate, sign, and package the certificates needed to set up a secure connection for the Web Server. |