happy phoneSSL encrypted websockets

The websocket protocol allows for two kinds of transport, unencrypted ws:// sockets and encrypted wss:// ones. The server on a given port is either listening unencrypted initially for http:// connections, or encrypted for https:// ones using SSL. Today I added optional SSL support for libwebsockets using OpenSSL, so it now supports encrypted or unencrypted types. When you connect by encrypted, you simply use a https:// URL to the server. The server returns the script over the encrypted link, and the script on the client side opens a wss:// websocket on the server. Otherwise the encryption is completely transparent. In particular, the callback the library makes back into the user code for the server is totally unaware if it is being used over SSL or not. I adapted the javascript that the test server sends to open ws:// or wss:// according to whether its own URL was http:// or https://. The test server builds its own test https:// certificate, browsers correctly warn that the CA is not recognized but otherwise the certs work correctly in Firefox 4.0b6 and Chrome 8.0.552.28 beta, both current on Fedora F15 rawhide.

Changed license to lgpl2.1

I realized that GPL2 isn't the best idea for this as a library so I changed the terms to LGPL-2.1 making it easier to integrate with systems using other licenses.

Autotools

The build system has also been moved to autotools / libtool so it has a traditional ./configure structure that should survive crossplatform builds better. It now has an --enable-openssl switch to control if openssl is needed. You can get libwebsocket via git by: git clone git://git.warmcat.com/libwebsockets