Commit Graph

702 Commits

Author SHA1 Message Date
Joel Martin e4b9d510f1 websocket.py: split out handshake parsing.
This makes it easier to use the websocket code in a WSGI script in the
future.
2012-07-13 13:09:32 -05:00
Joel Martin 65e96176cb websockify: change cfg file syntax and clean up parsing.
Config file syntax is now like this:

----------------------
    # Comments and blank lines are allow
    token1: host1:port1

    token2: host2:port2
----------------------
2012-07-12 19:34:27 -05:00
Joel Martin 52beba8695 Move target-list processing to websockify.
websocket.py has no concept of target/proxy so any target processing
should happen in websockify itself.

Also:

- remove URL parsing imports from websocket.py since they are not
  needed with SimpleHTTPRequestHandler doing the parsing.

- read the absolute path of the target_list file on startup since the
  --web option will change directories if set.
2012-07-12 19:10:12 -05:00
Hector Sanjuan e17e1158d8 Enable multiple targets in websockify by passing a target-list configuration file.
The --target-list option is used to pass a configuration file on websockify start.

This file contains entries in the form host:port:token, one per line.

When a new connection is open (from noVNC for example), the url should look like:

ws://websockify_host:websockify_port/?token=ABCD

The token is then extracted and checked against the entries in the configuration file.

When the token matches, the connection is proxied to the host:port indicated in the file.

If the configuration file is a folder, then all the entries from files in it are read.
2012-07-11 16:00:13 +02:00
Joel Martin 2a8df6327e Merge pull request #49 from libricoleur/master
Better support of IPv6
2012-06-26 07:40:38 -07:00
Alexandre Sicard 67d4c17516 Allow preference of IPv6 for source_addr
Add the option "-6, --prefer-ipv6". When set, the 'prefer_ipv6' flag in
websocket.py is used so that 'source_addr' is resolved to IPv6 if
available. If 'source_addr' is not set, binds to [::].
2012-06-26 13:57:50 +02:00
Alexandre Sicard 1f5b492e10 Support IPv6 brackets notation
Parse square brackets-enclosed IPv6 for 'source_addr' and 'target_addr'
parameters.
2012-06-26 13:55:19 +02:00
Joel Martin cb925eb486 doc/websockify.1: add man page for websockify command.
Mostly it is based on the project README.md but with some tweaks and
extra content removed.

Thanks for Adam Young <ayoung@redhat.com> for the original version of
this.

Also a decent man format reference is here:
http://www.fnal.gov/docs/products/ups/ReferenceManual/html/manpages.html
2012-06-22 18:40:11 -05:00
Joel Martin e295098330 Fix wrap mode when used with --web option.
- The --web option changes directory so the wrap mode needs to get an
  absolute path to the rebinder.
- Also, use long instead of int in rebind.c so avoid compile warnings.
2012-05-31 09:20:01 -05:00
Joel Martin cddc1613ff Fixup bugs from merge (pull #46).
- Rename unix socket option to '--unix-target' to be consistent with
  '--ssl-target' which is an analogous switch.
- Fix normal socket target mode which was broken after merge.
- Normalize/fix output for SSL, unix socket and wrap command modes.
2012-05-31 09:17:51 -05:00
Joel Martin 233b622e47 Merge pull request #46 from cloud9ers/master
Adding support for unix sockets as target socket.
2012-05-30 07:22:29 -07:00
Karim Allah Ahmed c7ba8c7826 Merge with kanaka's mainstream master branch 2012-05-28 13:09:07 +02:00
Joel Martin 89d2c92474 Move SSL target support into websocket.py.
This is cleanup related to:
https://github.com/kanaka/websockify/pull/45
2012-05-23 09:20:08 -05:00
Joel Martin d24f474362 Merge pull request #45 from d4nshields/master
feature from issue #8: Support connecting to SSL/TLS target socket
2012-05-23 06:47:14 -07:00
Karim Allah Ahmed f3054df53a Adding TCP_NODELAY to the source sockets 2012-05-22 16:49:00 +02:00
Karim Allah Ahmed c8018f29c9 Adding support for proxying from a unix socket 2012-05-22 16:09:07 +02:00
Daniel Shields 763d2d7c1c Feature: target_host is wrapped in SSL using --ssl-target option 2012-05-20 13:58:45 -04:00
Joel Martin e1c206b315 Release version 0.1.0 2012-05-11 12:12:50 -05:00
Joel Martin 63600bf422 Fix return code when client closes. 2012-05-10 22:00:27 -05:00
Joel Martin 19a9730744 Make CClose exception work in python 2.4.
Fixes https://github.com/kanaka/websockify/issues/41
2012-05-10 08:04:30 -05:00
Joel Martin 7a4dbad3e8 Fix latency test.
For echo/latency tests default to current host:port or URL.
2012-04-25 13:44:37 -05:00
Joel Martin 9a88f1800c Better close code/reason handling. 2012-04-25 13:44:01 -05:00
Joel Martin 37c0c80a93 C websockify: add --run-once option. 2012-04-13 10:36:16 -05:00
Joel Martin aef7ab3a57 Clean socket shutdown in C version too.
Related to https://github.com/kanaka/noVNC/issues/58 (supporting Apple
Remote Desktop).
2012-03-23 12:17:50 -05:00
Joel Martin 27c3da1908 Fix feature matrix link and clarify paragraph. 2012-02-23 17:45:27 -06:00
Joel Martin 9fcd92c39a Remove copy of kumina implementation.
The canonical location is https://github.com/kumina/wsproxy

There are now several external implementations of Websockify that
I link to from
https://github.com/kanaka/websockify/wiki/Feature_Matrix
2012-02-23 17:18:10 -06:00
Joel Martin 7ea468b5d7 Node impl to use einaros/ws and support HyBi.
Also adds web serving functionality and Flash policy service.
2012-02-23 17:06:35 -06:00
Joel Martin 9decfe1c95 Don't swallow SSL EOF errors. 2012-02-20 16:34:30 -06:00
Joel Martin cb839e85c4 Pull base64.js from noVNC.
Better illegal character debug output.
2012-02-20 15:49:18 -06:00
Joel Martin 31716a7265 Merge pull request #31 from SlapOS/master
Eggify websockify
2012-02-18 12:53:04 -08:00
Cédric de Saint Martin 301f3ae580 Eggify websockify 2012-02-18 09:43:12 +01:00
Joel Martin db17151941 Sync include/webutil.js with noVNC. 2012-02-14 17:37:01 -06:00
Joel Martin 7d44853da7 Pull include/util.js from noVNC. Add map to arrays for IE9.
IE9 still doesn't support [].map() so add it to the prototype in
include/util.js.
2012-02-14 07:51:44 -06:00
Joel Martin b405cdae7b Rename client.html to simple.html 2012-02-09 17:47:22 -06:00
Joel Martin e02b698015 Add simple client: tests/client.html. 2012-02-09 17:46:47 -06:00
Joel Martin bea32aebed Handle partial HyBi client frames. Cleanup buffer names.
Significant refactor of decode_hybi() and use of it in do_proxy().
2012-02-03 11:55:03 -06:00
Joel Martin bc1ea59867 Fix response to empty close frame. 2012-02-02 11:06:19 -06:00
Joel Martin b76c357f3f Fix --ssl-only option. 2012-02-02 08:11:06 -06:00
Joel Martin 8e95f18f99 Add openssl cert generation procedure to README. 2012-02-02 07:05:55 -06:00
Joel Martin 27ec5cff89 Remove more wswrapper Makefile references. 2012-02-02 06:51:39 -06:00
Joel Martin e2497313f5 Remove pointless md5_test.c file. 2012-02-01 19:17:56 -06:00
Joel Martin 04b3b2057c HyBi/IETF 6455 support to C websockify.
It's probably broken and it's definitely still messy in several ways,
but basic tests work with Chrome.

Several other C websockify cleanups:

- Remove most of the non-thread safe global variable usage (still
  a little bit that could be fixed so that threading would be easier).

- Remove wswrapper. It is unmaintained, out of date, and never worked
  well anyways (since it really needed a way to do asynchronous queued
  work but it was running in another process context making that
  hard).

- Use md5 routines from openssl.

- Remove md5.c and md5.h since no longer needed.

Thanks to https://github.com/dew111 for spurring me on to get this
done by writing code. I didn't end up using much his forked code, but
having something there goaded me enough to just get it working.
2012-02-01 19:10:39 -06:00
Joel Martin b2940c035f Show SSL error string. 2012-01-31 15:20:57 -06:00
Joel Martin 9ed4a17d70 Move alternate implementation data to wiki. 2012-01-30 15:00:58 -06:00
Joel Martin 6549c04fae Ignore clojure/lein artifacts. 2012-01-30 13:40:55 -06:00
Joel Martin 2c053f349c Clojure websockify: -main and command line args.
Can now be launched like so:

lein run websockify --web ../../noVNC/ 6080 localhost:5901
2012-01-30 13:38:18 -06:00
Joel Martin f2f838f7e2 Split generic websocket code out from websockify.
Generic TCP client and Websocket server code is now split out from the
websockify specific code.
2012-01-27 16:01:17 -06:00
Joel Martin 3278905ead Better error handling in Clojure Websockify.
Also, disable verbose debug.
2012-01-27 15:37:35 -06:00
Joel Martin a5d4fe1d18 Working vesrion Clojure Websockify.
Still needs some cleanup related to cleaning up client and target
connections.
2012-01-27 15:14:45 -06:00
Joel Martin 297a818066 Working Clojure Netty client code. 2012-01-27 13:11:38 -06:00