Use wss when creating localhost connection to detect binary support

Some browsers (Firefox) reject unencrypted ws connections if the hosting
page uses https by throwing an exception when you create the websocket
object.

NoVNC interprets this as binary being unsupported, and falls back to
base64.

If we instead connect to wss://localhost, the websocket object can be
created regardless of whether the hosting page is on http or https.
Merge pull request #329 from Medical-Insight/fix-shift-chars

Fixes #326: correct handling of shift key
Add support for TightVNC auth type
Removes the connection timeouts to enable slower clients, connections or servers.
Merge pull request #336 from samhed/removeConnectionTimeout

Remove the connection timeouts
Merge pull request #327 from devicenull/master

Add support for connecting to TightVNC servers
Implement XVP auth
Implement XVP extension (shutdown/reboot/reset)
Implement XVP UI in HTML
Merge pull request #242 from Medical-Insight/use-wss-for-binary-detect

Use wss when creating localhost connection to detect binary support (closes #242)
WebSocket protocols are now configurable.
Merge pull request #338 from vatesfr/configurable-ws-protocols

WebSocket protocols are now configurable
Better key identifiers

Previously we identified keys in keyboard events by the 'key' property
if it was set, and 'keyCode' otherwise.

This turns out to be problematic as Firefox no longer leaves 'key'
undefined (so we fall back to using 'keyCode'), but instead sets 'key'
to 'MozPrintableKey' for all printable keys.

This meant that when (printable) keys are released, we can't match it
against the corresponding keydown event, and instead just send a keyup
event for the last keydown received.

Now, if both 'key' and 'keyCode' are set, use the concatenation of both.
Otherwise prefer 'keyCode', as that is at least unique for every key.

This should let us release the right keys on keyup events.
Better browser OS detection.

Apparently Firefox on Linux changed the value of navigator.appVersion,
causing our OS detection (used to determine how to interpret different
modifier keys) to fail.

Use navigator.platform instead, which should be more stable.

http://stackoverflow.com/a/19883965/33213