Monday, September 26, 2011

Websocket Server Demonstration

Visit the High Level Logic (HLL) Website
— Home of XPL (eXtensible Process Language)

It's like XML, but you can store source code in it.

(January 12, 2013: Related article: WebSockets with Apache Tomcat and HLL)

Subject: Pre-release demonstration for developers and others who are willing to install advanced browsers. When ready, this server will be available free to developers, with or without the HLL application software. The current version is set-up as a gateway and will include simple http processing at the time of release. (You won't have to have another server running to load web pages.)

Update (Oct. 2, 2011): Latest version of the websocket protocol (known as hybi-17) has been submitted as a proposed standard. (public notice) Technically, hybi-17 is expected to represent the first websocket standard, although there may still be revisions to the text of the written standard.

The HLL International Websocket Server is another fast, lightweight HLL component. (Running on localhost, response appears instantaneous, even with multiple “rapid-fire” requests.) I've been developing it independently so that it can act as a websocket server for all applications, whether they are HLL applications or not. HLL components will be added to make construction of any websocket application easier. HLL applications will use websockets seamlessly.

The current version is still under development. (I guess I'm just proving my sincerity with this demo.) The demonstration is like a lot of others found on the web. The web page is a bit more sophisticated. (You can download the code here, but note that it is unlikely to work unless installed on a server.) It's built for development and test, and modified as I go. But the underlying experience is that of a simple echo server. No complex applications have yet been built. I will however, hook up the robot simulation application when the server is fully integrated with HLL.

Since HLL supports distributed computing, using components anywhere in the world, the server responds to a new connection with a “Hello World!” message in Swedish: “Hallå Världen!” The default message to the echo server contains foreign characters that lie far outside the range of utf-8 (English). The server does not merely echo back the message. It processes the message first, without gumming it up; and returns its version of what it read.


The websocket standard is not yet final and I have only tested on a limited number of advanced browsers that support the most recent (i.e. proposed final) version of the websocket protocol. It works fine using Google Chrome dev-channel Chromium 14 and above and Firefox 7 and above. You should also expect to be unsuccessful when trying to connect through a proxy server. Most proxy servers have not been updated to handle websockets and will deliver an incorrect request header, causing the request to fail.

You will not get a response from the server when using browsers that do not support close to final (or final) versions of the actual websocket standard protocol or if your request runs through a proxy server (which modifies the request headers such that they are no longer compliant). The browser application will say "CONNECTION REQUESTED ...." after you click the "Open Connection" button. After a wait period it will tell you that the application is "DISCONNECTED".

Opera is currently supporting an older draft of the websocket standard that the HLL websocket server does not support. I'll hold out a bit longer to see if Opera announces an upgrade soon. Opera has done excellent work in support of the HTML5 standard generally and I want to support people who use it. The older draft version of the websocket standard will not be the final version however, so I keep expecting to hear about an Opera upgrade any time now.

I've gone so far as to set up the web page for MSIE. 8 or above to load Google's plug-in to support websockets. But I have not been willing so far to spend a few hours getting the common dhtml I've used to construct the web page working in MSIE. Maybe later. Microsoft reports that their browser will support websockets in version 10. (UPDATE: Demo on MSIE)

The demonstration server will be upgraded fairly frequently. I suspect there will be little chance that it will not be available for that reason when you try it, but it could happen. Important upgrades (such as the addition of http service) will be reported in this blog when they're ready. But because browser support for websockets is under development, I kind-of expect at least one major crash on at least one browser before it's all done. (Update: Not so much anymore. Things have been going smoothly.) I'm optimistic though. You should be too. If the web page loads a bit slowly, note that it isn't being delivered from the HLL WebSocket server.

You are invited to provide feedback. Simply add a comment under this article, or contact me by email.

If you have an appropriate web-browser, click here for the demonstration.

(January 12, 2013: Related article: WebSockets with Apache Tomcat and HLL)