The purpose of the code is to be incorporated into other web projects
(whether those are free or not). AGPL prevents combination with other
HTML and javascript that is under a weaker (or proprietary) license.
Better would be a lesser AGPL, but there is not GNU standard for that.
So LGPL-3 meets most of my requirements. If somebody modifies the
actual client code and conveys it, then they must release the changes
under LGPL-3 also.
Add some implementation notes in docs/notes.
- By dereferencing the 'data' field of the imageData object before the
loop, the hextile performance on Chrome is down to 140ms or so for
a full 800x600 update. Still have to fall back to Canvas operations
for firefox.
- Fix RQ empty after reorder bug.
Fixes:
- Make sure that failed state messages stay around until next connect.
- Get status message font colors working.
- Clear RQ_reorder list on re-connect.
- For webkit engines, do array manipulation for each tile subrectangle
and only use the array for putImageData after rendering is finished.
In Chrome 5.0.375.29 beta, the time to render a full 800x600 hextile
image dropped from 500ms to 250ms or so. Firefox 3.5.3 rendering of
a full 800x600 hextile image is about 2300ms.
- 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.
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.
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.
- Refactor to pull off all the data received into RFB.d array and then
process it. This allows a bit more flexibility in handling
data that isn't sent in frame boundary packets.
- Properly ignore these server messages: SetColourMapEntries, Bell,
ServerCutText.
- Hextile has an undocumented weirdness where RAW frames are often
followed by a 0 byte that should be ignored.
- Coallesce client messages that are one after another. Without
this the server seems to often ignore frames that are send right
after another frame has been sent. This fixes a reconnect issue
where setEncodings seems to be ignored. Also results in a huge
performance increase after key strokes (by adding a update request
to the key event message) because the server always sends an update
instead of sometimes waiting for the next poll to be sent.