- 13 Jan, 2011 1 commit
-
-
Joel Martin authored
https://github.com/kanaka/websockify is now the canonical location of websockify (formerly wsproxy). A copy of the python version is kept here for backwards compatibility and ease-of-use. The other versions and related test scripts are in websockify.
-
- 12 Jan, 2011 1 commit
-
-
Joel Martin authored
wswrapper: Getting the wswrapper.c LD_PRELOAD model working has turned out to involve too many dark corners of the glibc/POSIX file descriptor space. I realized that 95% of what I want can be accomplished by adding a "wrap command" mode to wsproxy. The code is still there for now, but consider it experimental at best. Minor fix to dup2 and add dup and dup3 logging. wsproxy Wrap Command: In wsproxy wrap command mode, a command line is specified instead of a target address and port. wsproxy then uses a much simpler LD_PRELOAD library, rebind.so, to move intercept any bind() system calls made by the program. If the bind() call is for the wsproxy listen port number then the real bind() system call is issued for an alternate (free high) port on loopback/localhost. wsproxy then forwards from the listen address/port to the moved port. The --wrap-mode argument takes three options that determine the behavior of wsproxy when the wrapped command returns an exit code (exit or daemonizing): ignore, exit, respawn. For example, this runs vncserver on turns port 5901 into a WebSockets port (rebind.so must be built first): ./utils/wsproxy.py --wrap-mode=ignore 5901 -- vncserver :1 The vncserver command backgrounds itself so the wrap mode is set to "ignore" so that wsproxy keeps running even after it receives an exit code from vncserver. wstelnet: To demonstrate the wrap command mode, I added WebSockets telnet client. For example, this runs telnetd (krb5-telnetd) on turns port 2023 into a WebSockets port (using "respawn" mode since telnetd exits after each connection closes): sudo ./utils/wsproxy.py --wrap-mode=respawn 2023 -- telnetd -debug 2023 Then the utils/wstelnet.html page can be used to connect to the telnetd server on port 2023. The telnet client includes VT100.js (from http://code.google.com/p/sshconsole) which handles the terminal emulation and rendering. rebind: The rebind LD_PRELOAD library is used by wsproxy in wrap command mode to intercept bind() system calls and move the port to a different port on loopback/localhost. The rebind.so library can be built by running make in the utils directory. The rebind library can be used separately from wsproxy by setting the REBIND_OLD_PORT and REBIND_NEW_PORT environment variables prior to executing a command. For example: export export REBIND_PORT_OLD="23" export export REBIND_PORT_NEW="65023" LD_PRELOAD=./rebind.so telnetd -debug 23 Alternately, the rebind script does the same thing: rebind 23 65023 telnetd -debug 23 Other changes/notes: - wsproxy no longer daemonizes by default. Remove -f/--foreground option and add -D/--deamon option. - When wsproxy is used to wrap a command in "respawn" mode, the command will not be respawn more often than 3 times within 10 seconds. - Move getKeysym routine out of Canvas object so that it can be called directly.
-
- 08 Jan, 2011 1 commit
-
-
Joel Martin authored
Moved websocket.py code into a class WebSocketServer. WebSockets server implementations will sub-class and define a handler() method which is passed the client socket after. Global variable settings have been changed to be parameters for WebSocketServer when created. Subclass implementations still have to handle queueing and sending but the parent class handles everything else (daemonizing, websocket handshake, encode/decode, etc). It would be better if the parent class could handle queueing and sending. This adds some buffering and polling complexity to the parent class but it would be better to do so at some point. However, the result is still much cleaner as can be seen in wsecho.py. Refactored wsproxy.py and wstest.py (formerly ws.py) to use the new class. Added wsecho.py as a simple echo server. - rename tests/ws.py to utils/wstest.py and add a symlink from tests/wstest.py - rename tests/ws.html to tests/wstest.html to match utils/wstest.py. - add utils/wsecho.py - add tests/wsecho.html which communicates with wsecho.py and simply sends periodic messages and shows what is received.
-
- 07 Jan, 2011 1 commit
-
-
Joel Martin authored
- Added ability to respond to normal web requests. This is basically integrating web.py functionality into wsproxy. This is only in the python version and it is off by default when calling wsproxy. Turn it on with --web DIR where DIR is the web root directory. Next task is to clean up wsproxy.py. It's gotten unwieldy and it really no longer needs to be parallel to the C version.
-
- 04 Jan, 2011 1 commit
-
-
Joel Martin authored
Warn early about no SSL cert and add clearer warning when a connection comes in as SSL but no cert file exists. For the C version, cleanup closing of the connection socket. Use shutdown for a cleaner cleanup with the client.
-
- 06 Nov, 2010 2 commits
-
-
Joel Martin authored
-
Joel Martin authored
If only --cert is specified then continue to assume both certificate and key are in the same file (key first).
-
- 25 Sep, 2010 1 commit
-
-
Joel Martin authored
- include/rfb.js: Keep track of the number of rects of each encoding type and print them out when we close a connection (if 'info' logging level). - tests/vnc_perf.html: first pass at a noVNC based performance benchmark. - utils/wsproxy.py: Fix the output of the record filename.
-
- 23 Sep, 2010 1 commit
-
-
Joel Martin authored
- include/canvas.js: When 'debug' logging, show browser detection values. - test/canvas.html: Only restore the canvas to it's starting state if the logging level is not 'debug'. - wsproxy.py: Append the session number to the record filename so that multiple sessions don't stomp on each other.
-
- 11 Sep, 2010 1 commit
-
-
Joel Martin authored
Always fork handlers processes. Instead printing traffic when single-processing, print traffic if verbose flag given.
-
- 10 Sep, 2010 1 commit
-
-
Joel Martin authored
Add -m, --multiprocess option which forks a handler for each connection allowing multiple connections to the same target using the same proxy instance. Cleaned up the output of the handler process. Each process' output is prefixed with an ordinal value. Changed both the C and python versions of the proxy.
-
- 12 Aug, 2010 1 commit
-
-
Joel Martin authored
- This allows the recorded data to be immediately usable by tests/vnc_playback.html
-
- 06 Aug, 2010 1 commit
-
-
Joel Martin authored
Turns out when Windows is running in QEMU and a window scroll happens, there are lots of little hextile rects sent. This is slow in noVNC. - Some recording/playback improvement. - Add test harness to drive playback of recordings. - By pulling off the rect header in one chunk we get a 3X speedup in Chrome and a 20% speedup in firefox (specifically for the scroll test). - Also, get rid of some noise from creating timers for handle_message. Check to make sure there isn't already a pending timer first.
-
- 04 Aug, 2010 1 commit
-
-
Joel Martin authored
-
- 03 Aug, 2010 1 commit
-
-
Joel Martin authored
- When a packet with only '\xff\x00' is received, this means the client is doing an orderly shutdown. (WebSockets spec version 76)
-
- 17 Jul, 2010 1 commit
-
-
Joel Martin authored
The listen port should be opened before daemonizing otherwise if opening the port fails, the user will get no feedback. The only complication was that the listen socket needs to not be closed as part of daemonizing. Thanks to http://github.com/rickr for finding it.
-
- 17 Jun, 2010 3 commits
-
-
Joel Martin authored
-
Joel Martin authored
-
Joel Martin authored
Refactor how settings are passed around.
-
- 16 Jun, 2010 2 commits
-
-
Joel Martin authored
-
Joel Martin authored
This allows forwarding from an external port to the same port on localhost (loopback). I.e. ./utils/wsproxy `hostname -f`:5901 localhost:5901
-
- 07 Jun, 2010 1 commit
-
-
Joel Martin authored
-
- 01 Jun, 2010 1 commit
-
-
Joel Martin authored
-
- 26 May, 2010 1 commit
-
-
Joel Martin authored
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.
-
- 15 May, 2010 1 commit
-
-
Joel Martin authored
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.
-
- 11 May, 2010 2 commits
-
-
Joel Martin authored
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.
-
Kevin Chan authored
-
- 06 May, 2010 1 commit
-
-
Joel Martin authored
-
- 30 Apr, 2010 2 commits
-
-
wss://'Joel Martin authored
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.
-
Joel Martin authored
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.
-
- 19 Apr, 2010 1 commit
-
-
Joel Martin authored
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.
-
- 17 Apr, 2010 2 commits
-
-
Joel Martin authored
-
Joel Martin authored
- 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.*
-
- 16 Apr, 2010 1 commit
-
-
Joel Martin authored
-
- 06 Apr, 2010 1 commit
-
-
Joel Martin authored
-
- 03 Apr, 2010 1 commit
-
-
Joel Martin authored
-
- 01 Apr, 2010 2 commits
-
-
Joel Martin authored
- Requires wsproxy to proxy to the VNC server.
-
Joel Martin authored
-
- 31 Mar, 2010 1 commit
-
-
Joel Martin authored
- wsproxy.py: creates a web sockets to TCP socket proxy. - interact.html: prints received Web Sockets data and has text box to send strings.
-