Commit Graph

890 Commits

Author SHA1 Message Date
Joel Martin db504ade0c Isolate DOM references in load() and connect().
- Other misc cleanups.
2010-05-11 16:39:17 -05:00
Joel Martin ded9dfae10 Styling/integration refactoring.
- 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.
2010-05-11 16:13:52 -05:00
Joel Martin 3a2fafac9b Add and clarify licensing. 2010-05-11 10:01:21 -05:00
Joel Martin 92f572a249 Fix wsproxy CPU usage without affecting latency.
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.
2010-05-11 09:25:29 -05:00
Joel Martin 4ce2696d52 Merge branch 'merge_kevinykchan'
Conflicts:
	wsproxy.py

Fix auth mode selection typo.
2010-05-11 09:23:55 -05:00
Kevin Chan 3ec5d7c0a3 Addresses issue where wsproxy utilizes 100% CPU. The process now rarely goes over 2% 2010-05-11 22:07:04 +08:00
Kevin Chan 2cec49d439 If no password is provided, defaults to use no auth 2010-05-11 21:59:59 +08:00
Joel Martin 97bfe5ba25 Move controls to vnc.js, make vnc.html very simple. 2010-05-06 17:08:53 -05:00
Joel Martin fc7d416ee4 Ignore python bytecode files. 2010-05-06 10:57:16 -05:00
Joel Martin 05e5cb7da0 Fix same for server side (no expected count complaint). 2010-05-06 10:54:36 -05:00
Joel Martin 0340f8b6b1 Don't complain about expected count on stop. 2010-05-06 10:53:09 -05:00
Joel Martin f8ee7b489d Encryption suppport for wstest. 2010-05-06 10:52:04 -05:00
Joel Martin 95ef30a167 websocket.py: generic code from wsproxy and wstest. 2010-05-06 10:32:07 -05:00
Joel Martin c539e4dcda DES that works with KVM's VNC. RFB 3.8 fixes. 2010-05-05 15:40:05 -05:00
Joel Martin ef764d3b9b Support for RFB 3.8 handshake. 2010-05-02 14:19:13 -05:00
Joel Martin 5aca52e18d Cleanup. Move note files into docs/. 2010-05-01 15:59:52 -05:00
Joel Martin adfe6ac166 Support for SSL/TLS ('wss://') on both sides.
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.
2010-04-30 16:41:09 -05:00
Joel Martin ca5785f570 Automatically detect TLS/SSL during handshake.
Use MSG_PEEK flag on recv to detect whether we are getting a flash
policy request, an SSL/TLS header, or a plain socket connection.
2010-04-30 16:00:12 -05:00
Joel Martin 0e486e1ba0 Import as3crypto_patch: ffda6e9cd8b1d74f45472c676afda8360ae1e5aa
as3crypto is actionscript 3 crypto library with TLS engine support.

From: http://github.com/lyokato/as3crypto_patched

Which was forked from: http://code.google.com/p/as3crypto/
2010-04-30 14:13:32 -05:00
Joel Martin 7b99f70bd0 Don't erase failed state error messages on disconnect. 2010-04-19 10:46:48 -05:00
Joel Martin 0166284a64 Also send errors to console.error 2010-04-19 10:43:21 -05:00
Joel Martin 1e633bc8ee wstest*. Fix Opera problems. Flash policy. Misc bugs.
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.
2010-04-19 10:41:06 -05:00
Joel Martin 9e12c1a941 README.md typo and clarify. 2010-04-18 20:57:34 -05:00
Joel Martin 1626e0f8f8 Update README.md and TODO. 2010-04-18 20:53:54 -05:00
Joel Martin 07287cfd89 Send seq nums and b64 encode based on query string.
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.
2010-04-18 20:35:43 -05:00
Joel Martin 8759ea6f90 Status/error refactor. Fix firefox bugs.
- 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).
2010-04-18 18:43:03 -05:00
Joel Martin 07f6ca751d Remove mootools-more references. 2010-04-18 16:28:54 -05:00
Joel Martin 9fec75c08f Fix firefox '-' key mapping. 2010-04-18 16:19:10 -05:00
Joel Martin d1616107c3 Add fixing firefox '-' key mapping issue to TODO. 2010-04-18 16:17:27 -05:00
Joel Martin 10ae1427f8 Handle socket policy response in proxy itself. 2010-04-17 17:53:28 -05:00
Joel Martin 5d8e7ec068 Add web-socket-js support with packet re-ordering.
- 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.*
2010-04-17 17:24:14 -05:00
Joel Martin d920595453 Import web-socket-js: a0fb3933ce5c824bcb882f5a1cf87e46de773ea8
web-socket-js is a flash based WebSockets emulator.

From: http://github.com/gimite/web-socket-js
2010-04-17 17:23:31 -05:00
Joel Martin 5d2c386400 Reassemble partial client packets in wsproxy.py 2010-04-16 16:34:19 -05:00
Joel Martin af7a319387 Assemble partial received frames.
Apparently both native and flash WebSockets implementations can send
partial packets.
2010-04-16 15:53:59 -05:00
Joel Martin 89fbd66fa9 Add WebSockets test frontend and backend. 2010-04-16 13:58:08 -05:00
Joel Martin 14b665f1da Remove uneeded mootools functions and used compressed version. 2010-04-15 12:28:53 -05:00
Joel Martin 7345dba44c Clarify DES code origination. 2010-04-15 11:14:42 -05:00
Joel Martin b5537b60b0 Switch to MPL/GPL base64 from Mozilla.
- Also slightly better performance.
2010-04-15 11:01:40 -05:00
Joel Martin 1a623f7502 Update TODO and small perf cleanups. 2010-04-15 10:16:30 -05:00
Joel Martin 30059bdf24 Add cut and paste support.
- 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.
2010-04-15 01:40:03 -05:00
Joel Martin 66a529d70a In TODO: RRE framing bug fixed in prev refactor. 2010-04-14 23:42:38 -05:00
Joel Martin 1098b5bf01 Refactor FBU.bytes handling to simplify.
- raw encoding displays horizontal lines as they arrive for better
  feedback and less time hanging waiting for something.
2010-04-14 23:41:12 -05:00
Joel Martin 6321aff0cf stop routine stops mouseMove events too. 2010-04-14 23:40:29 -05:00
Joel Martin 9e5065ab83 Note WSS/SSL and C wsproxy in TODO. 2010-04-14 13:33:27 -05:00
Joel Martin 503c6c5be9 Add TODO. 2010-04-14 13:03:18 -05:00
Joel Martin 8cf206154c Working VNC client! Add mouse movement support.
- 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).
2010-04-14 12:44:47 -05:00
Joel Martin 48ebcdb110 Rename canvas.js routines to not have "rfb" prefix.
- Also, try making set fillStyle called less often.
2010-04-14 12:22:47 -05:00
Joel Martin 31af85b996 Don't clear canvas if debug mode 2010-04-14 12:13:59 -05:00
Joel Martin 28a5f29357 Re-order routines, no functional changes. 2010-04-14 12:10:23 -05:00
Joel Martin fb99d81ccc Better hextile performance: index subrects instead of slicing/shifting.
- 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.
2010-04-14 12:03:01 -05:00