Commit Graph

11 Commits

Author SHA1 Message Date
Joel Martin 8765971e06 Use /usr/bin/env shebang to make more crossplatform.
Based on noVNC pull request from Decorum.
2011-03-26 15:27:08 -05:00
Joel Martin 6954e4641d Better reaper, catch occasional bad WS header line.
Call waitpid in loop to catch SIGCHLD signals that happen while
handling the original SIGCHLD signal.
2011-02-01 10:46:28 -06:00
Joel Martin 0a2f850267 Reap websockify zombies. Add IE9 fix for websock.js.
Reap websockify zombies. Fixes:
https://github.com/kanaka/noVNC/issues#issue/47. Thanks NeilW.

Changes to get web-socket-js to work with IE9. Right now it's a hack to get
around: https://github.com/gimite/web-socket-js/issues#issue/41. The hack is to
disable caching of the flash objects by appending "?" + Math.random() to the
end of the flash object path (but only when using IE).
2011-01-31 10:34:42 -06:00
Joel Martin 70cef27dbe Add latency test and browser latency test results. 2011-01-19 15:25:44 -06:00
Joel Martin 6ff5dfa02d Strip "ws" from test names. Update TODO.
Also, rename wstest to load.
2011-01-19 13:19:47 -06:00
Joel Martin 9c4cf4ada2 Do not hang on non-ready client connection.
Wait 3 seconds for the client to send something. If no data is
available within 3 seconds then close the connection. It's probably
a non-WebSockets client that is waiting for the server to say
something first.
2011-01-13 12:22:22 -06:00
Joel Martin 6d1e216115 fork noVNC, rename to websockify, cleanup.
Split of wsproxy from noVNC and rename it websockify.
2011-01-12 18:09:54 -06:00
Joel Martin 7210e79e04 Move wsproxy and web utils into utils/ subdir. 2010-06-07 12:49:57 -05:00
Joel Martin 507b473a2e 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.
2010-05-28 15:39:38 -05:00
Joel Martin 0a72cf9026 Reset client_settings on connect.
- Otherwise client_setting carry over from other connections.
2010-05-15 12:14:30 -05:00
Joel Martin 95ef30a167 websocket.py: generic code from wsproxy and wstest. 2010-05-06 10:32:07 -05:00