Commit Graph

890 Commits

Author SHA1 Message Date
Sören Schwert 57be17d7f5
Convert old print statement into function
For Python 3 compatibility.
2020-07-28 14:35:49 +02:00
Pierre Ossman 86a20b23f5 Update test requirements
Travis are dropping older Python environments, so update things to
something that reflects what current distributions are using (e.g. Red
Hat Enterprise Linux 7).
2020-04-08 09:18:09 +02:00
Feng Ye 7bd955a379 Add UnixDomainSocketDirectory token plugin 2020-03-18 10:40:18 +08:00
Pierre Ossman 6d48b1507e Make sure port is a simple string (again)
The redis token plugin also needs to make sure the port string isn't
unicode for compatibility with Python 2.x.
2020-02-27 15:55:35 +01:00
Pierre Ossman 76897b5093 Log connection errors better 2020-02-27 15:54:29 +01:00
Samuel Mannehed 4ecff119c4
Merge pull request #405 from andersk/shell
run: Fix shell scripting bugs
2019-09-26 08:42:17 +02:00
Anders Kaseorg 5052f823d7 run: Fix shell scripting bugs
* Use double quotes around `"$@"` to fix invocation with arguments
  including spaces.
* Use double quotes around `"$(dirname "$0")"` to fix invocation
  inside a directory path including spaces.
* Use `set -e` to abort in case `cd` fails.
* Use `exec` to avoid forking an unnecessary wrapper process.
* Skip an unnecessary `cd` → `pwd` → `cd` dance, just use `cd`.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-08-17 11:39:46 -07:00
Pierre Ossman 654cbac77e websockify 0.9.0 2019-08-13 13:56:31 +02:00
Pierre Ossman 4ed68eab97 Update release instructions 2019-08-13 13:56:31 +02:00
Pierre Ossman 312a6d200c Mark package description as being Markdown
PyPi is now very picky about the format and will not accept things
blindly.
2019-08-13 13:53:16 +02:00
Samuel Mannehed 53004a071d Remove javascript files from setup.py
The js implementation of websockify has been split into a different
repository, this means that these files are no longer present here.
2019-07-14 23:22:10 +02:00
Samuel Mannehed 1553fa791e
Merge pull request #362 from CendioOssman/split
Remove all non-Python stuff from the tree
2019-07-12 13:44:22 +02:00
Pierre Ossman 6d82536d2b Fix all old kanaka links
We now have our own organisation for noVNC and friends.
2019-07-04 13:11:13 +02:00
Pierre Ossman 368ec2c06e Remove all non-Python stuff from the tree
We're splitting the repository into multiple ones. This one will
only retain the Python stuff (and rebind, used by websocketproxy).

Only once license is needed after this, so use the standard COPYING
filename.
2019-07-04 11:27:40 +02:00
Pierre Ossman 60acf3cd3c Use direct javascript in test files
Avoid relying on our own modules as we are about to split things up.
2019-07-03 15:56:25 +02:00
Pierre Ossman b46fab5608 Make sure the port is a simple string
getaddrinfo() gladly allows unicode for the host, but the port must
be in ascii (e.g. "https"). Make sure this is properly converted
before we pass it on.

Patch by @caderize on GitHub.
2019-07-03 12:29:02 +02:00
Pierre Ossman 6a268a09b6 Use safer method to get base directory
realpath isn't available on older systems, so use a safer approach
using just very basic commands.
2019-06-24 15:38:52 +02:00
Pierre Ossman 1f717e83af Remove information on building Python SSL module
Even old systems have this module these days, so these instructions
only serve to confuse people.
2019-06-24 15:32:21 +02:00
Pierre Ossman 60413587ac Merge branch 'patch-1' of https://github.com/Hyask/websockify 2019-06-17 15:21:14 +02:00
Skia 4f6a82159c run: invoke websockify through 'python -m' 2019-06-17 15:04:43 +02:00
Skia f21a7d33a2 Add a __main__.py file for invocation as a module
This file allows an easy invocation of websockify as a module, which is handy when running into shebang issues (https://github.com/pypa/virtualenv/issues/596).
With this patch, `python -m websockify ...` has just the same behavior as `./run ...`.
2019-06-13 17:16:25 +02:00
Pierre Ossman b382c4f6a7 Use Ubuntu Trusty (14.04) for Travis
Python 2.6 is not available in the newer environment, so make sure
we're getting the one we need for now.
2019-06-13 13:38:43 +02:00
Pierre Ossman 01a184f4a9 Make TokenRedis optional
Most installations will not have redis or simplejson installed, so
avoid having them as a hard requirement unless actually using the
TokenRedis plugin.
2019-05-24 12:56:23 +02:00
Giuseppe Corbelli 70911c6d6e [websocketproxy] Fixed base class call to process_request() when using
ThreadingMixIn
2019-05-15 14:58:47 +02:00
Pierre Ossman c1edd7818d Merge branch 'master' of https://github.com/PexMor/websockify 2019-05-09 15:51:45 +02:00
PexMor ff3fdd149d novnc redis backed token_plyugins.py 2019-04-29 20:32:04 +02:00
Pierre Ossman be9823bf93 Use client IP in logs, not host
This is the more common behaviour, and it is also more reliable as
it may require some time to look up hostnames and they may change
over time.
2019-04-25 10:05:14 +02:00
Pierre Ossman e4658ada2e Re-enable Windows support
It works well enough now with the recent fixes and a modern Python.
2019-04-02 17:04:19 +02:00
Pierre Ossman 85074b6eb5 Use ThreadingMixIn for the simple server
ForkingMixIn isn't available on Windows. This is the simple server
without features, so use ThreadingMixIn to keep things consistent.
2019-04-02 17:03:08 +02:00
Pierre Ossman d751ec44a8 Allow main script to be imported
We should only start the server if we are the main module, and not
imported some other way. This is important for multiprocessing to
work correctly on Windows.
2019-04-02 17:02:08 +02:00
Samuel Mannehed 6e09ec2548
Merge pull request #382 from Nevon/ssl-key-passphrase
Add option for cert key password
2019-03-13 13:34:03 +01:00
Tommy Brunn 92cb3d8355 Rename certificate key password option 2019-03-04 09:31:01 +01:00
Tommy Brunn 0163e4060b Add option for cert key password 2019-03-02 17:21:28 +01:00
Samuel Mannehed c136ea2d34
Merge pull request #380 from totaam/master
fix handling of "code"
2019-02-24 22:43:21 +01:00
totaam a348b8bf76 fix handling of code: invalid unpacking, undefined variable in error path, missing argument 2019-02-23 12:37:16 +07:00
UXabre f2031eff05 Added JWT/JWS/JWE tokens capability 2019-02-15 03:45:57 -05:00
Pierre Ossman f0bdb0a621 Handle connection failures
The service we're proxying to might not be responding. Make sure
this is caught sanely and we get nice logging and messages back to
the client.
2018-10-23 16:31:57 +02:00
Pierre Ossman 8eb5cb0cdc Explicitly deny text messages
We can't really handle them, but let's respond with an explicit error
rather than "unknown opcode".
2018-10-23 16:31:07 +02:00
Pierre Ossman 6a9e446f8e Avoid : in recording file names
That character is not legal in Windows file names, so make sure we
avoid it when creating recording files.
2018-10-16 16:10:37 +02:00
Pierre Ossman 7abd7ac4a9 Merge branch 'master' of https://github.com/josedpedroso/websockify 2018-09-10 16:39:32 +02:00
josedpedroso 7e29a36f6a Syslog now RFC 5424 compliant and properly identified. 2018-08-28 19:52:47 +01:00
Pierre Ossman be5d30ad25 Change WebSocket request handler to a mix-in
We can't get the inheritence right in non-trivial cases as a regular
base class, so change it to be a mix-in that is to be combined with
one of the existing request handlers from the Python library.
2018-08-15 17:07:37 +02:00
josedpedroso d80c607cb6 Port no longer included in token when using --host-token 2018-07-12 20:21:08 +01:00
Pierre Ossman 6ba82d371b Merge branch 'master' of https://github.com/josedpedroso/websockify 2018-07-11 13:37:17 +02:00
josedpedroso 8cb89d2340 Clarified usage of --host-token and added a section about installing Python websockify in the README. 2018-07-06 14:33:13 +01:00
Tomasz Barański 7c816eb207 Added command line options for minum SSL version and SSL ciphers
--ssl-version takes two possible values (tlsv1_1, tlsv1_2). Defaults
to tlsv1_1.
--ssl-ciphers takes allowed ciphers in the same format as
`openssl ciphers`.

Added options for 1.3 and the default ssl config
2018-07-05 21:55:29 +02:00
Tomasz Barański 51ad14d16c Enable setting SSL ciphers and SSL options
The change adds two options to WebSockifyServer. The first is a list of
SSL ciphers. The second is SSL options (intended use is to force a
specific TLS version).

Those two options allow for greater security of WebSocket Proxy.
2018-07-05 21:54:20 +02:00
josedpedroso 08b402d111 Added a couple of paragraphs about plugins and the new options to the README. 2018-07-05 00:55:12 +01:00
josedpedroso af85184e28 Added --host-token to allow choosing target by hostname. 2018-07-05 00:54:19 +01:00
josedpedroso 44bb213a72 Improved --help. 2018-07-05 00:53:09 +01:00