Commit Graph

724 Commits

Author SHA1 Message Date
Solly Ross 50bf29671d Merge pull request #228 from jrziviani/master
Enable unix socket to work with token plugin
2016-06-30 16:54:35 -04:00
Solly Ross 0a56d7dc6c Merge pull request #239 from javacruft/mox3
Switch test dependency to mox3
2016-06-30 16:40:03 -04:00
James Page 5be951440a Switch test dependency to mox3
mox is pretty much unmaintained these days, however the OpenStack
project are actively maintaining mox3 (a Python 3 compatibile fork
with some other improvements).

websockify seems quite happy to use mox3 instead, so switch the
test dependency and associated imports to use mox3.
2016-06-30 09:59:50 +01:00
samhed 8d82b8898b Disable Nagle for proxied connections
Most of the proxy stuff will be latency sensitive traffic so we
disable Nagle because it introduces delays.
2016-06-02 14:45:51 +02:00
Gernot Tenchio 483d3cabc5 C websockify: free memory after failed handshake
Conflicts:
	other/websocket.c
2016-04-22 12:04:31 -05:00
Solly Ross 1e92c3e6fd Update to 0.8.0
See CHANGES.txt for more information
2016-02-18 14:11:15 -05:00
Solly Ross 567385ecac Merge pull request #226 abhishekkekane/bug/138
Make websockify respond to SIGTERM
2016-02-18 13:43:30 -05:00
Abhishek Kekane 7509077504 Make websockify respect SIGTERM
Child processes were not terminated when the parent websockify
was killed.

This commit makes websockify send a SIGTERM to all active children
when the parent process is terminated.

Fixes #138
2016-02-18 13:42:53 -05:00
Jose Ricardo Ziviani 607ca0aa4d Enable unix socket to work with token plugin
This commit adds support to unix sockets in the token plugin, thus it is
possible to have a token files like:

  token: unix_socket:/path/to/socket_file

A single websockify instance will be able to handle multiple sockets.

Signed-off-by: Jose Ricardo Ziviani <jose@ziviani.net>
2016-02-16 13:51:13 -02:00
Solly Ross c3f56c280d Merge pull request #219 from noah8713/master
Remove logging in signal handlers
2016-01-11 16:28:02 -05:00
Aliasgar Ginwala a42230be65 Remove additional signal calls in websockify that causes novnc to hang.
Openstack nova novnc-proxy services uses websockify to provide support
for nova vms using novnc proxy. At present, novnc hangs every couple of
weeks. It only resumes post restart of the novnc-proxy which is not
good. Hence, this code in websockify is updated to get rid of additional
signal calls to avoid novnc going in hang state even though process is
running. Basically, we are getting rid of existing msg and vmsg calls in
the websocket.py. This is kind of quick fix but we will need an
additional way of figuring out the logging to make it easy to trace in
case of any further failures in future.

closes bug: https://github.com/kanaka/noVNC/issues/556
2016-01-08 17:46:35 -08:00
Samuel eaa6407a1f Merge pull request #215 from miguelxpn/logfile
Add information about new logging files functionality in README
2015-12-05 13:19:44 +01:00
Miguel Xavier Penha Neto 492f9ac4ef Add information about new logging files functionality in README
Fix minor typo in mini-webserver section
2015-12-04 22:41:02 -02:00
Solly Ross e2e2201847 Merge pull request #214 from miguelxpn/logfile
Fix log files when daemonizing
2015-12-03 12:51:56 -08:00
Miguel Xavier Penha Neto b45e43b560 Fix log files when daemonizing
Save log file descriptor so it's not closed when calling daemonize()
2015-12-02 15:21:21 -02:00
Solly Ross ebe378c6db Merge pull request #205 from miguelxpn/logfile
Add support for log files
2015-12-01 10:25:23 -08:00
Miguel Xavier Penha Neto 1c6eb1872e Add support for log files
Override log_message in websocket.py so messages from send_error are properly saved into the log files

Closes #204
2015-12-01 15:25:17 -02:00
Solly Ross ea6152a02c Bump NPM Version
This commit is prep for releasing the Node version for v0.7.1
on NPM.

Closes #199.
2015-10-12 15:37:03 -04:00
Solly 223e9608d7 Merge pull request #201 from quinox/basicauth
Verify username/password with BasicAuth plugin
2015-10-06 22:39:27 -04:00
Ceesjan Luiten abde08d260 Verify username/password with BasicAuth plugin 2015-10-06 12:09:22 +02:00
Joel Martin 9b3dc9bb7f Merge pull request #198 from halfgaar/master
Clarified SSL section in README
2015-10-05 12:15:50 -05:00
Wiebe Cazemier 7823764799 Clarified SSL section in README 2015-10-05 11:27:36 +02:00
Solly 13e68b2cf6 Merge pull request #197 from miguelxpn/issue196
Add support for IPv6 addresses in tokens
2015-09-30 16:53:56 -04:00
Miguel Xavier Penha Neto 1f3d06f998 Added support for IPv6 addresses in tokens
Fixes #196
2015-09-30 16:04:19 -03:00
Solly b5f967dd52 Merge pull request #194 from kanaka/feature/http-auth-plugins
Rework Auth Plugins to Support HTTP Auth
2015-08-28 13:52:58 -04:00
Solly Ross 04e80d1c74 Merge pull request #192 from grz0/master
Fix bug in JSONTokenApi plugin

Closes #192
2015-08-27 18:09:58 -04:00
grz0 5bc60b6b41 Fix bug in JSONTokenApi plugin
`Response#json` is a method, not a property, in the
requests library.

[directxman12: removed unnecessary calls to str]
2015-08-27 18:08:39 -04:00
Arata Notsu 0e4b6d5c45 Avoid UnboundLocalError for exc
Previously exc was set only when an exception occurs in the inner
try (the one contains call to self.poll), so an error in the other
part causes an UnboundLocalError.

Closes #178
2015-08-27 18:03:38 -04:00
Solly 7e927b80a6 Merge pull request #185 from timkurvers/fix/js/drop-base64-dependency
Drop pkrumins/node-base64 dependency
2015-08-27 17:58:24 -04:00
Solly Ross 997e2151b3 Rework Auth Plugins to Support HTTP Auth
This commit reworks auth plugins slightly to enable
support for HTTP authentication.  By raising an
AuthenticationError, auth plugins can now return
HTTP responses to the upgrade request (such as 401).

Related to kanaka/noVNC#522
2015-08-25 17:52:20 -04:00
Solly Ross 1e894f0d29 Fix auth plugins on Python 3.x
Python 3 does not have a `getheader` method on the header object,
and instead uses just `get`.
2015-08-25 17:50:22 -04:00
Solly cbfe2b3b45 Merge pull request #186 from timkurvers/fix/js/node-modules-ignore
Correct .gitignore path for js node_modules
2015-08-11 13:37:57 -04:00
Solly c73ba2b0e0 Merge pull request #187 from timkurvers/fix/js/spdx-license-identifier
Correct SPDX license identifier for LGPL-3.0
2015-08-05 15:32:56 -04:00
Tim Kurvers 627b71135d Correct SPDX license identifier for LGPL-3.0 2015-08-01 16:32:56 +02:00
Tim Kurvers ff3c91e503 Ignore node_modules correctly 2015-08-01 16:19:30 +02:00
Tim Kurvers f45944d4d9 Drop pkrumins/node-base64 dependency 2015-08-01 16:10:58 +02:00
Solly Ross f8679c4b05 Update to 0.7.0
See CHANGES.txt for details.
2015-07-23 21:02:37 -04:00
Solly c7568c3010 Merge pull request #176 from crodjer/venv-with-run
Make `run` respect virtualenv configuration
2015-06-02 15:39:03 -04:00
Rohan Jain 47f26519c6 Make `run` respect virtualenv configuration
Signed-off-by: Rohan Jain <crodjer@gmail.com>
2015-05-15 16:54:38 +05:30
Solly 4d1ec3c038 Merge pull request #175 from kanaka/bug/catch-interrupted-syscall
Catch interrupted system call
2015-05-13 16:52:31 -04:00
Bennett Kanuka edcbfcb9eb Catch interrupted system call
Closes #166
2015-05-13 16:15:25 -04:00
Solly Ross 2544dd3aaf Introduce strict mode
This commit introduces strict mode, which is on by default.  Currently
strict mode only enforces client-to-server frame masking.  However,
in the future, it might enforce other parts of the RFC as well.

Closes #164
2015-05-13 16:03:57 -04:00
Solly Ross 461c52ed84 Enable Travis
This commit enables running the unit tests on Travis for Python 2.6,
2.7, 3.3, and 3.4.  Note that Travis does not support Python 2.4, so
we cannot test there.
2015-05-13 16:03:57 -04:00
Solly Ross 6b79718782 Update Tests and Test Plugins
This commit updates the unit tests to work with the current code
and adds in tests for the auth and token plugin functionality.
2015-05-13 16:03:57 -04:00
Solly Ross 6d5209751d Process plugin parameters in main
Previously, we just passed the values of '--*-plugin' and
'--*-source' directly to `LibProxyServer` and `WebSocketProxy`,
which handled turning that into an instance of the plugin class.
Now, that's done in main, and the classes receive an instance
directly.
2015-05-13 16:03:56 -04:00
Solly Ross 21a51b8c39 Fix bug in ReadOnlyTokenFile
ReadOnlyTokenFile didn't initialize `self._targets` to `None`,
causing issues.
2015-05-13 16:03:37 -04:00
Solly Ross 4e53e672ee Introduce Auth Plugins
Auth plugins provide a generic interface for authenticating requests.

The plugin name is specified using the '--auth-plugin' option, and
may either be the name of a class from `websockify.auth_plugins`,
or a fully qualified python path to the auth plugin class (see below).

An optional plugin parameter can be specified using the '--auth-source'
option (a value of `None` will be used if no '--auth-source' option is
specified).

Auth plugins should inherit from `websockify.auth_plugins.BasePlugin`,
and should implement the `authenticate(headers, target_host, target_port)`
method.  The value of the '--auth-source' option is available as
`self.source`.

One plugin is currently included: `ExpectOrigin`.  The `ExpectOrigin`
plugin checks that the 'Origin' header is an expected value.  The list
of acceptable origins is passed using the plugin source, as a
space-separated list.
2015-05-13 16:03:37 -04:00
Solly Ross 1e5b3e6644 Restore functionaltiy to file_only.
There was a bug in WebSocketServer that prevented the `file_only`
parameter from actually being set as an instance property, causing
directory listings to appear even with `file_only=True`.  This
commit fixes that.

See-Also: https://bugs.launchpad.net/nova/+bug/1447675
2015-05-13 16:03:37 -04:00
Aric Stewart d0444f1fd5 Add ping heartbeat option
With this option we will ping the client with a heartbeat.
Helpful for connection through firewalls that may disable inactive
connections.
2015-04-14 16:09:26 -05:00
Aric Stewart 2bd5c8febd Add option to turn on auto-pong
This allows the websockify server to respond to heart beat ping
messages sent by clients
2015-04-13 14:57:24 -05:00