- Instead of onload override, move to RFB.load function that takes
a parameter for the target DOM ID. This allows the user to have
their own onload function.
- Add "VNC_" prefix to all element ID names. Only create DOM elements
if they don't already exist on the page, otherwise use the existing
elements.
- Move all styling to separate stylesheet.
- Use list model for control styling.
Instead of selecting on everything every time, only select the writers
that we have items queued for. Most of the time the writers are ready
so if we select on them even when we don't have anything to send we
will fall into a tight loop.
On the client side, this adds the as3crypto library to web-socket-js
so that the WebSocket 'wss://' scheme is supported which is WebSocket
over SSL/TLS.
Couple of downsides to the fall-back method:
- This balloons the size of the web-socket-js object from about 12K to 172K.
- Getting it working required disabling RFC2718 web proxy support
in web-socket-js.
- It makes the web-socket-js fallback even slower with the
encryption overhead.
The server side (wsproxy.py) uses python SSL support. The proxy
automatically detects the type of incoming connection whether flash
policy request, SSL/TLS handshake ('wss://') or plain socket
('ws://').
Also added a check-box to the web page to enable/disabled 'wss://'
encryption.
Lame. Opera doesn't support javascript reduce().
Also, Opera seems to just plain be pathetic when it comes to
delivering the web-socket-js events. Around 1/5 to 1/3 of all received
packets are never received as an event at all.
- Change default delay for send side to 10ms.
- Use a textarea for errors so that even without console.* support
(ala firebug) we still see the errors that are happening.
Query string variable 'b64encode' determine if wsproxy b64 encodes the
results. Variable 'seq_num' determines if sequence numbers are
prepended. This way, sequence numbers are only used with the flash
WebSocket proxy.
- All state/status updates go through updateState routine which
updates the status line also.
- Old firefox (and opera) don't support canvas createImageData, so use
getImageData as replacement.
- Add console.warn and console.error stubs so that firefox without
firebug doesn't crap out.
- If no WebSockets then error if no flash or if URL is location (flash
will refuse to load the object for security reasons).
- web-socket-js is from http://github.com/gimite/web-socket-js. It is
a flash object that emultates WebSockets.
Unfortunately, events (or packets) from the web-socket-js object can
get re-ordered so we need to know the packet order.
- So wsproxy.py prepends the sequence number of the packet when
sending.
- If the client receives packets out of order it queues them up and
scans the queue for the sequence number it's looking for until
things are back on track. Gross, but hey: It works!
- Also, add packet sequence checking to wstest.*
- A textarea below the VNC area represents the state of the current
VNC clipboard. If there is a server cut event, the textarea will be
updated. If the user updates the contents of the textarea, the new
data will be sent as a client paste (cut) event.
- One important change was to detect if the clipboard is focused and
allow the user to type in the clipboard instead of in the VNC area.
- Mouse movements are accumulated and sent about 5 times a second.
- Normal polling happens at about 1.5 seconds intervals.
This commit represents a very functional VNC client under Google
Chrome.
Remaining work:
- Cut and paste support.
- Framing bugs when using RRE encoding.
- Better status and error feedback.
- Get working in firefox using flash web-socket-js:
http://github.com/gimite/web-socket-js
- Version without mootools (but test cross-browser).
- Many times better performance. Before this, browser was spending all
it's time garbage collecting or doing something. Now the bottleneck
is in set fillStyle and fillRect which is probably where it should
be.