]> git.proxmox.com Git - mirror_novnc.git/log
mirror_novnc.git
13 years agoClean up top level: move license files to docs/
Joel Martin [Thu, 15 Jul 2010 23:45:32 +0000 (18:45 -0500)]
Clean up top level: move license files to docs/

13 years agoUTF-8: send 0 as 256 during encoding too.
Joel Martin [Wed, 14 Jul 2010 21:57:02 +0000 (16:57 -0500)]
UTF-8: send 0 as 256 during encoding too.

0 is valid UTF-8, but in order to avoid WebSockets framing, we
encode/decode it as 256.

Also, be tolerant of 0 length messages.

13 years agoAdd native base64 test (atob and btoa).
Joel Martin [Tue, 13 Jul 2010 22:53:01 +0000 (17:53 -0500)]
Add native base64 test (atob and btoa).

Interestingly it turns out that using the native base64 routines does
not improve performance. Likely because the actual time is in
marshalling/unmarshalling between strings and arrays (and associated
garbage collection overhead) which has to be done either way.

13 years agoTightPng fixups and thanks to Sentry Data Systems.
Joel Martin [Tue, 13 Jul 2010 22:51:26 +0000 (17:51 -0500)]
TightPng fixups and thanks to Sentry Data Systems.

- Change tightpng encoding number to -260 (aliguori provided it until
  an official number can be allocated).

13 years agoScreenshots section, link to more.
Joel Martin [Fri, 9 Jul 2010 16:41:36 +0000 (11:41 -0500)]
Screenshots section, link to more.

13 years agoREADME.md: caption formatting.
Joel Martin [Fri, 9 Jul 2010 15:52:42 +0000 (10:52 -0500)]
README.md: caption formatting.

13 years agoREADME.md: image caption and bigger dimensions.
Joel Martin [Fri, 9 Jul 2010 15:51:51 +0000 (10:51 -0500)]
README.md: image caption and bigger dimensions.

13 years agoAdd screenshots to README.md.
Joel Martin [Fri, 9 Jul 2010 15:50:33 +0000 (10:50 -0500)]
Add screenshots to README.md.

13 years agoMarkdown links in README.md.
Joel Martin [Wed, 7 Jul 2010 21:06:44 +0000 (16:06 -0500)]
Markdown links in README.md.

13 years agoLinks related to Tight PNG encoding work.
Joel Martin [Wed, 7 Jul 2010 17:41:19 +0000 (12:41 -0500)]
Links related to Tight PNG encoding work.

13 years agoRemoved missed mootools include in ws.html test.
Joel Martin [Wed, 7 Jul 2010 17:40:56 +0000 (12:40 -0500)]
Removed missed mootools include in ws.html test.

13 years agoAdd troubleshooting section.
Joel Martin [Tue, 6 Jul 2010 17:29:37 +0000 (12:29 -0500)]
Add troubleshooting section.

13 years agoRemove unneeded mootools and FABridge test.
Joel Martin [Tue, 6 Jul 2010 17:14:38 +0000 (12:14 -0500)]
Remove unneeded mootools and FABridge test.

mootools is no longer needed. The bug that the FABridge test was
testing has been resolved in web-socket-js so it's no longer needed.

13 years agoRefactor console logging code.
Joel Martin [Tue, 6 Jul 2010 16:56:13 +0000 (11:56 -0500)]
Refactor console logging code.

Util.Debug, Util.Info, Util.Warn, Util.Error routines instead of
direct calls to console.*. Add "logging=XXX" query variable that sets
the logging level (default is "warn").

Logging values:
    debug: code debug logging (many calls in performance path are also
           commented for performance reasons).
    info: informative messages including timing information.
    warn: significant events
    error: something has gone wrong

13 years agoInit updated web-socket-js correctly. TODO updates.
Joel Martin [Mon, 5 Jul 2010 20:54:15 +0000 (15:54 -0500)]
Init updated web-socket-js correctly. TODO updates.

13 years agoDisable excanvas experiment.
Joel Martin [Fri, 2 Jul 2010 19:25:12 +0000 (14:25 -0500)]
Disable excanvas experiment.

Also, move bugs from TODO to github issues.

13 years agoA little more cleanup of browser table.
Joel Martin [Fri, 2 Jul 2010 17:50:34 +0000 (12:50 -0500)]
A little more cleanup of browser table.

13 years agoMore browser table cleanup.
Joel Martin [Fri, 2 Jul 2010 17:40:29 +0000 (12:40 -0500)]
More browser table cleanup.

13 years agoRemove unsupported table colors. Cleanup table.
Joel Martin [Fri, 2 Jul 2010 17:34:37 +0000 (12:34 -0500)]
Remove unsupported table colors. Cleanup table.

13 years agoREADME.md: try browser tests in table.
Joel Martin [Fri, 2 Jul 2010 17:25:13 +0000 (12:25 -0500)]
README.md: try browser tests in table.

13 years agoTest table in markdown.
Joel Martin [Fri, 2 Jul 2010 17:12:30 +0000 (12:12 -0500)]
Test table in markdown.

13 years agoREADME/TODO: Windows browser testing results.
Joel Martin [Fri, 2 Jul 2010 17:02:57 +0000 (12:02 -0500)]
README/TODO: Windows browser testing results.

13 years agoRebuild web-socket-js swf with gimite updates.
Joel Martin [Fri, 2 Jul 2010 15:50:52 +0000 (10:50 -0500)]
Rebuild web-socket-js swf with gimite updates.

Bug fixes, restore RFC2817 proxy for non wss://, and handle new closing
handshake from WebSockets 76.

13 years agoAdd global variable option for swf location.
Joel Martin [Fri, 2 Jul 2010 14:54:55 +0000 (09:54 -0500)]
Add global variable option for swf location.

The problem is, you can't set WebSocket.__swfLocation before you load
web_socket.js (because it creates the WebSocket global), but you also
can't reliably set WebSocket.__swfLocation after because if you are
doing dynamic script file includes then the onload (i.e.
WebSocket.__initialize) may fire before you have a chance to set
Websocket.__swfLocation.

13 years agoImport/merge gimite/web-socket-js up to da7caff96496c7d7bfb3.
Joel Martin [Fri, 2 Jul 2010 14:52:59 +0000 (09:52 -0500)]
Import/merge gimite/web-socket-js up to da7caff96496c7d7bfb3.

Bug fixes, restore RFC2817 proxy for non wss://, and handle new
closing handshake from WebSockets 76.

13 years agoClarify browser results in README.md
Joel Martin [Thu, 1 Jul 2010 17:18:18 +0000 (12:18 -0500)]
Clarify browser results in README.md

13 years agoRemove sequence code in client and proxies.
Joel Martin [Thu, 1 Jul 2010 17:13:17 +0000 (12:13 -0500)]
Remove sequence code in client and proxies.

13 years agoUpdate web-socket-js binary build and README.md
Joel Martin [Thu, 1 Jul 2010 17:04:26 +0000 (12:04 -0500)]
Update web-socket-js binary build and README.md

Brings it up to date with the most recent web-socket-js event handling
fixes.

13 years agoOpera fixes and big Opera performance boost.
Joel Martin [Thu, 1 Jul 2010 16:54:44 +0000 (11:54 -0500)]
Opera fixes and big Opera performance boost.

Add message/state pollling in web-socket-js. Since Opera tends to drop
message events, we can dramatically increase performance by polling
every now for message event data.

Also, add more direct calls to update readyState so that it's not
missed when Opera drops events.

13 years agoBetter web-socket-js dataQueue reset.
Joel Martin [Thu, 1 Jul 2010 15:35:03 +0000 (10:35 -0500)]
Better web-socket-js dataQueue reset.

At connect and close time instead of initialization time.

13 years agoweb-socket-js event fixes.
Joel Martin [Thu, 1 Jul 2010 15:32:14 +0000 (10:32 -0500)]
web-socket-js event fixes.

When using web-socket-js, the onopen event may happen inline so the
caller may not have time to set onopen before the event fires. In this
case set a short timeout and try again. In particular this affects
Opera most of the time.

Also, to get around Opera event droppings, always read the readyState
directly instead of relying on the local readyState variable to be
correct (which it isn't if stateChange event were dropped).

13 years agoAlways prefer JS ops if we have imageData.
Joel Martin [Thu, 1 Jul 2010 15:30:07 +0000 (10:30 -0500)]
Always prefer JS ops if we have imageData.

All browsers with Canvas imageData are faster with JS ops instead of
canvas ops. This gives significant performance improvement in Opera.
Except for missing web-socet-js message notifications, Opera 10.60 is
now faster than firefox 3.5.

13 years agoOpera works! Fix message event drops/reorders.
Joel Martin [Thu, 1 Jul 2010 14:53:38 +0000 (09:53 -0500)]
Opera works! Fix message event drops/reorders.

Instead of relying on FABridge AS -> JS event delivery, we just use
the events to notify JS of pending data. The message handler then
calls the AS readSocketData routine which sends back an array of
the pending WebSocket frames.

There is still a minor bug somewhere that happens after the first
connect where the web-socket-js throws an "INVALID_STATE_ERR: Web
Socket connection has not been established". But, Opera is now usable
and we should be able to drop the packet sequence numbering and
re-ordering code.

Another minor issue to better support Opera is to move JS script
includes to the <head> of the page instead of after the body.

13 years agoUpdate C proxy to WS protocol version 76.
Joel Martin [Thu, 1 Jul 2010 01:39:41 +0000 (20:39 -0500)]
Update C proxy to WS protocol version 76.

Pull in LGPL md5.c and md5.h files (written by Ulrich Drepper).

Now both python and C version of the proxy support both protocol 75
and protocol 76 (hybi 00).

Reorganize websocket.py slightly to match websocket.c.

13 years agoSignificant firefox perf improvement. Update TODOs.
Joel Martin [Tue, 29 Jun 2010 19:36:18 +0000 (14:36 -0500)]
Significant firefox perf improvement. Update TODOs.

Interesting. Enough has changed in the Canvas tile operations, that
Canvas.prefer_js=true is better for firefox/gecko too. Approximately
2X improvement in firefox for large hextile renders.

13 years agoFix issue #7: security scheme list parsing.
Joel Martin [Sat, 26 Jun 2010 22:41:39 +0000 (17:41 -0500)]
Fix issue #7: security scheme list parsing.

Also, lower connect timeout to 2 seconds.

13 years agoRemove proxy handshake debug.
Joel Martin [Thu, 24 Jun 2010 23:45:30 +0000 (18:45 -0500)]
Remove proxy handshake debug.

13 years agoAdd WebSockets spec links.
Joel Martin [Thu, 24 Jun 2010 23:42:45 +0000 (18:42 -0500)]
Add WebSockets spec links.

13 years agoAdd missing full GPL-3 text.
Joel Martin [Thu, 24 Jun 2010 23:04:40 +0000 (18:04 -0500)]
Add missing full GPL-3 text.

13 years agoRefactor canvas imageData test slightly.
Joel Martin [Thu, 24 Jun 2010 22:09:54 +0000 (17:09 -0500)]
Refactor canvas imageData test slightly.

13 years agoSupport WebSockets 76 (hixie-76, hybi-00).
Joel Martin [Thu, 24 Jun 2010 22:04:57 +0000 (17:04 -0500)]
Support WebSockets 76 (hixie-76, hybi-00).

Looks like disabling web-socket-js debug messages by default that we
get a minor speedup.

Python proxy should support both 75 and 76 (00) modes. Also, update ws
test to more reliably hit the WebSockets ordering/drop issue.

13 years agoRemove invalid pos check from web-socket-js.
Joel Martin [Thu, 24 Jun 2010 22:01:58 +0000 (17:01 -0500)]
Remove invalid pos check from web-socket-js.

13 years agoMissed change web-socket-js to dd80a1807758abfab4a0fde840f94c5d649e4a24.
Joel Martin [Thu, 24 Jun 2010 22:00:41 +0000 (17:00 -0500)]
Missed change web-socket-js to dd80a1807758abfab4a0fde840f94c5d649e4a24.

13 years agoAdd web-socket-js debug flag and default to off.
Joel Martin [Thu, 24 Jun 2010 21:59:53 +0000 (16:59 -0500)]
Add web-socket-js debug flag and default to off.

13 years agoSquelch MD5.as build warnings.
Joel Martin [Thu, 24 Jun 2010 21:58:24 +0000 (16:58 -0500)]
Squelch MD5.as build warnings.

13 years agoTODO: Test IE 9 preview 3.
Joel Martin [Thu, 24 Jun 2010 17:55:26 +0000 (12:55 -0500)]
TODO: Test IE 9 preview 3.

13 years agoUpdate gimite/web-socket-js to dd80a1807758abfab4a0fde840f94c5d649e4a24
Joel Martin [Thu, 24 Jun 2010 17:42:34 +0000 (12:42 -0500)]
Update gimite/web-socket-js to dd80a1807758abfab4a0fde840f94c5d649e4a24

13 years agoTODO: already got Arora 0.5 working.
Joel Martin [Thu, 24 Jun 2010 16:19:19 +0000 (11:19 -0500)]
TODO: already got Arora 0.5 working.

13 years agoTODO (WebSockets version 76) and Opera/Arora.
Joel Martin [Thu, 24 Jun 2010 16:12:49 +0000 (11:12 -0500)]
TODO (WebSockets version 76) and Opera/Arora.

13 years agoAdd proxy functionality description.
Joel Martin [Thu, 24 Jun 2010 15:50:36 +0000 (10:50 -0500)]
Add proxy functionality description.

13 years agoVarious cross-browser fixes.
Joel Martin [Wed, 23 Jun 2010 21:08:36 +0000 (16:08 -0500)]
Various cross-browser fixes.

Now working under Arora 0.5.

But not Konqueror 4.2.2 (WebSockets never connects).

IE support with excanvas still pending.

13 years agoFix browser detection code in IE.
Joel Martin [Mon, 21 Jun 2010 21:30:32 +0000 (16:30 -0500)]
Fix browser detection code in IE.

13 years agoUpdate README.md with browser support.
Joel Martin [Mon, 21 Jun 2010 18:20:57 +0000 (13:20 -0500)]
Update README.md with browser support.

13 years agoBetter support console debug under Opera (DragonFly).
Joel Martin [Sun, 20 Jun 2010 20:10:34 +0000 (15:10 -0500)]
Better support console debug under Opera (DragonFly).

13 years agoTimeout connection.
Joel Martin [Fri, 18 Jun 2010 20:18:41 +0000 (15:18 -0500)]
Timeout connection.

13 years agoUpdate usage and README.md.
Joel Martin [Thu, 17 Jun 2010 22:50:15 +0000 (17:50 -0500)]
Update usage and README.md.

13 years agoMore arg processing fixes.
Joel Martin [Thu, 17 Jun 2010 22:24:54 +0000 (17:24 -0500)]
More arg processing fixes.

13 years agoArgument processing fixes. Misc proxy fixes.
Joel Martin [Thu, 17 Jun 2010 22:05:33 +0000 (17:05 -0500)]
Argument processing fixes. Misc proxy fixes.

13 years agoAdd daemonization support to wsproxy.*.
Joel Martin [Thu, 17 Jun 2010 21:06:18 +0000 (16:06 -0500)]
Add daemonization support to wsproxy.*.

Refactor how settings are passed around.

13 years agoUpdate TODO.
Joel Martin [Thu, 17 Jun 2010 14:31:13 +0000 (09:31 -0500)]
Update TODO.

13 years agoForce SSL option to proxies. Use getopt_long.
Joel Martin [Wed, 16 Jun 2010 18:58:00 +0000 (13:58 -0500)]
Force SSL option to proxies. Use getopt_long.

13 years agoUpdate TODO.
Joel Martin [Wed, 16 Jun 2010 18:57:10 +0000 (13:57 -0500)]
Update TODO.

13 years agoBetter C proxy host resolution.
Joel Martin [Wed, 16 Jun 2010 18:11:07 +0000 (13:11 -0500)]
Better C proxy host resolution.

Use getaddrinfo instead of gethostbyname.

13 years agoAdd listen address to proxy (C and python).
Joel Martin [Wed, 16 Jun 2010 17:37:03 +0000 (12:37 -0500)]
Add listen address to proxy (C and python).

This allows forwarding from an external port to the same port on
localhost (loopback). I.e.

./utils/wsproxy `hostname -f`:5901 localhost:5901

13 years agoRemove debug sendCtrlC function.
Joel Martin [Wed, 16 Jun 2010 14:48:49 +0000 (09:48 -0500)]
Remove debug sendCtrlC function.

13 years agoDisabled ctrlAltDel button when N/A.
Joel Martin [Tue, 15 Jun 2010 22:56:38 +0000 (17:56 -0500)]
Disabled ctrlAltDel button when N/A.

13 years agoAdd CtrlAltDel send button to status bar.
Joel Martin [Tue, 15 Jun 2010 22:47:01 +0000 (17:47 -0500)]
Add CtrlAltDel send button to status bar.

Some default_controls.js jslinting.

Needs to be some modularity between controls you probably always want
(like sending CtrlAltDel) and how the interface is presented and
controlled.

13 years agoNo mootools dep outside of default_controls.js.
Joel Martin [Tue, 15 Jun 2010 20:21:41 +0000 (15:21 -0500)]
No mootools dep outside of default_controls.js.

Some basic functions from mootools implemented in util.js.

Also, some more DOM separation. Move clipboard focus logic into
default_controls and canvas and out of vnc.js.

JSLint cleanup.

13 years agoAdd mouse position routines to util.js.
Joel Martin [Tue, 15 Jun 2010 16:10:18 +0000 (11:10 -0500)]
Add mouse position routines to util.js.

On path towards removing dependency on mootools in non-UI code.

13 years agoMove DOM event handling from vnc.js to canvas.js.
Joel Martin [Tue, 15 Jun 2010 14:36:23 +0000 (09:36 -0500)]
Move DOM event handling from vnc.js to canvas.js.

13 years agoMove vnc.js into include directory.
Joel Martin [Mon, 14 Jun 2010 19:56:19 +0000 (14:56 -0500)]
Move vnc.js into include directory.

Also, allow 'include/' to be overridden in VNC_uri_prefix.

13 years agoAdd summary timing info on disconnect.
Joel Martin [Mon, 14 Jun 2010 19:43:21 +0000 (14:43 -0500)]
Add summary timing info on disconnect.

Also, move Frame Buffer Update code out of normal_msg into separate
function.

13 years agoLess debug output.
Joel Martin [Mon, 14 Jun 2010 19:42:34 +0000 (14:42 -0500)]
Less debug output.

13 years agoMove cert gen to Usage section of README.md.
Joel Martin [Mon, 14 Jun 2010 19:34:05 +0000 (14:34 -0500)]
Move cert gen to Usage section of README.md.

13 years agoRender PNG images in order. Update TODO.
Joel Martin [Sun, 13 Jun 2010 16:00:12 +0000 (11:00 -0500)]
Render PNG images in order. Update TODO.

13 years agoFix mouse focus issues.
Joel Martin [Sun, 13 Jun 2010 15:57:23 +0000 (10:57 -0500)]
Fix mouse focus issues.

13 years agoFix scrolled mouse position.
Joel Martin [Thu, 10 Jun 2010 21:05:15 +0000 (16:05 -0500)]
Fix scrolled mouse position.

13 years agoDesktopResize and compression level pseudo-encodings.
Joel Martin [Thu, 10 Jun 2010 20:44:42 +0000 (15:44 -0500)]
DesktopResize and compression level pseudo-encodings.

- Implement resizing of desktop pseudo-encoding.

- Also send lowest (fastest) compression level pseudo-encoding.
  Ought be user tweakable.

13 years agoMore dynamic encoding list handling.
Joel Martin [Thu, 10 Jun 2010 17:11:13 +0000 (12:11 -0500)]
More dynamic encoding list handling.

13 years agobase64 encode instead of escaping images.
Joel Martin [Wed, 9 Jun 2010 22:50:06 +0000 (17:50 -0500)]
base64 encode instead of escaping images.

13 years agoAlmost double firefox tight_png render performance.
Joel Martin [Wed, 9 Jun 2010 20:40:46 +0000 (15:40 -0500)]
Almost double firefox tight_png render performance.

When extracting the data URI info, much more efficient in firefox to
iterate and push onto an array, then to generate the whole array at
once using the map function.

Chrome is mostly unaffected by this change (might be slightly better).

13 years agoTIGHT_PNG encoding and timing refactor.
Joel Martin [Wed, 9 Jun 2010 20:00:32 +0000 (15:00 -0500)]
TIGHT_PNG encoding and timing refactor.

Also, generate encodings array to send from a list of encodings
instead of being hardcoded generator function.

13 years agoupdate failed state on WS onerror.
Joel Martin [Tue, 8 Jun 2010 16:20:03 +0000 (11:20 -0500)]
update failed state on WS onerror.

Also, slightly faster non-base64 (UTF-8) decode.

13 years agoOutput count for multi-packet decodes.
Joel Martin [Mon, 7 Jun 2010 19:36:26 +0000 (14:36 -0500)]
Output count for multi-packet decodes.

13 years agoAdd UTF-8 wire encoding support to C wsproxy.
Joel Martin [Mon, 7 Jun 2010 18:47:44 +0000 (13:47 -0500)]
Add UTF-8 wire encoding support to C wsproxy.

13 years agoMove wsproxy and web utils into utils/ subdir.
Joel Martin [Mon, 7 Jun 2010 17:47:02 +0000 (12:47 -0500)]
Move wsproxy and web utils into utils/ subdir.

13 years agoC wsproxy: seq numbers and decode multiple frames.
Joel Martin [Mon, 7 Jun 2010 17:44:02 +0000 (12:44 -0500)]
C wsproxy: seq numbers and decode multiple frames.

13 years agoFirst pass at working C wsproxy.
Joel Martin [Fri, 4 Jun 2010 22:10:06 +0000 (17:10 -0500)]
First pass at working C wsproxy.

No sequence numbering and only support b64encoding at the moment.

13 years agoGive better exception feedback in message handler.
Joel Martin [Fri, 4 Jun 2010 18:51:21 +0000 (13:51 -0500)]
Give better exception feedback in message handler.

13 years agoAdd 'tight' encoding to TODO list. Add rfb proto link.
Joel Martin [Thu, 3 Jun 2010 21:11:21 +0000 (16:11 -0500)]
Add 'tight' encoding to TODO list. Add rfb proto link.

13 years agoFix Alt keysym.
Joel Martin [Thu, 3 Jun 2010 14:28:44 +0000 (09:28 -0500)]
Fix Alt keysym.

From kevinychan/vnc-html5 ebfffdc36.

13 years agoClarify examples.
Joel Martin [Thu, 3 Jun 2010 13:39:42 +0000 (08:39 -0500)]
Clarify examples.

13 years agoExplain VNC_uri_prefix in README.md.
Joel Martin [Wed, 2 Jun 2010 22:28:28 +0000 (17:28 -0500)]
Explain VNC_uri_prefix in README.md.

13 years agoUpdate README.md to reflect separate default controls file.
Joel Martin [Wed, 2 Jun 2010 22:18:46 +0000 (17:18 -0500)]
Update README.md to reflect separate default controls file.

13 years agoDirect example. Move all DOM code default_controls.js.
Joel Martin [Wed, 2 Jun 2010 22:08:25 +0000 (17:08 -0500)]
Direct example. Move all DOM code default_controls.js.

Move DOM manipulation into include/default_controls.js and update
vnc.html to use it.

Add an example vnc_auto.html which automatically connects using
parameters from the query string and doesn't use default_controls.js.

Reorder functions in vnc.js to put external interface functions at the
top of the RFB namespace.

13 years agoAdd --record option to wsproxy.py.
Joel Martin [Tue, 1 Jun 2010 22:58:14 +0000 (17:58 -0500)]
Add --record option to wsproxy.py.

13 years agoAdd colour map support (non-true-color).
Joel Martin [Tue, 1 Jun 2010 19:34:27 +0000 (14:34 -0500)]
Add colour map support (non-true-color).

In colourMap mode there are 256 colours in a colour palette sent from
the server via the SetColourMapEntries message. This reduces the
bandwidth by about 1/4. However, appearance can be somewhat less than
ideal (pinks instead of gray, etc).

It also increases client side rendering performance especially on
firefox. Rendering a full 800x600 update takes about 950ms in
firefox on my system compared to about 1400ms. Round-trip time for
a full frame buffer update is even better on firefox (due to
performance of the flash WebSocket emulator). Reduced from about
1800ms to 1100ms on firefox (for 800x600 full update).

13 years agoTest non-base64 (straight UTF-8) encoding.
Joel Martin [Fri, 28 May 2010 20:39:38 +0000 (15:39 -0500)]
Test non-base64 (straight UTF-8) encoding.

Also add a wsencoding test client/server program to test send a set of
values between client and server and vice-versa to test encodings.

Not turned on by default.

Add support for encode/decode of UTF-8 in the proxy. This leverages
the browser for decoding the WebSocket stream directly instead of
doing base64 decode in the browser itself.

Unfortunately, in Chrome this has negligible impact (round-trip time
is increased slightly likely due to extra python processing).

In firefox, due to the use of the flash WebSocket emulator the
performance is even worse. This is because it's really annoying to get
the flash WebSocket emulator to properly decode a UTF-8 bytestream.
The problem is that the readUTFBytes and readMultiByte methods of an
ActionScript ByteArray don't treat 0x00 correctly. They return
a string that ends at the first 0x00, but the index into the ByteArray
has been advanced by however much you requested.

This is very silly for two reasons: ActionScript (and Javascript)
strings can contain 0x00 (they are not null terminated) and second,
UTF-8 can legitimately contain 0x00 values. Since UTF-8 is not
constant width there isn't a great way to determine if those methods
in fact did encounter a 0x00 or they just read the number of bytes
requested.

Doing manual decoding using readUTFByte one character at a time slows
things down quite a bit. And to top it all off, those methods don't
support the alternate UTF-8 encoding for 0x00 ("\xc0\x80"). They also
just treat that encoding as the end of string too.

So to get around this, for now I'm encoding zero as 256 ("\xc4\x80")
and then doing mod 256 in Javascript. Still doesn't result in much
benefit in firefox.

But, it's an interesting approach that could use some more exploration
so I'm leaving in the code in both places.

13 years agoRound-trip timing for first full FBU.
Joel Martin [Fri, 28 May 2010 20:29:36 +0000 (15:29 -0500)]
Round-trip timing for first full FBU.

13 years agoFix web-socket-js: encode sent data across FABridge.
Joel Martin [Fri, 28 May 2010 19:10:57 +0000 (14:10 -0500)]
Fix web-socket-js: encode sent data across FABridge.