Commit Graph

857 Commits

Author SHA1 Message Date
Wiebe Cazemier 3c04cf8c45 Clarified SSL section in README 2015-10-05 11:27:36 +02:00
Solly 62c3a59192 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 e401701311 Added support for IPv6 addresses in tokens
Fixes #196
2015-09-30 16:04:19 -03:00
Solly 714aa34e4e 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 05cac26257 Merge pull request #192 from grz0/master
Fix bug in JSONTokenApi plugin

Closes #192
2015-08-27 18:09:58 -04:00
grz0 487db5f7c9 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 f693871c58 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 b445296816 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 1e2b5c2256 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 6c1543c05b 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 b7684e0914 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 12432c9b06 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 2051c2419f Correct SPDX license identifier for LGPL-3.0 2015-08-01 16:32:56 +02:00
Tim Kurvers cb6b309dad Ignore node_modules correctly 2015-08-01 16:19:30 +02:00
Tim Kurvers addc2e6b20 Drop pkrumins/node-base64 dependency 2015-08-01 16:10:58 +02:00
Solly Ross 69c04c819c Update to 0.7.0
See CHANGES.txt for details.
2015-07-23 21:02:37 -04:00
Till Zimmermann 92fc7872c7 Allow tab to be sent via telnet 2015-07-06 23:54:28 +02:00
Solly 558a6439f1 Merge pull request #176 from crodjer/venv-with-run
Make `run` respect virtualenv configuration
2015-06-02 15:39:03 -04:00
Rohan Jain 2b9e0a5794 Make `run` respect virtualenv configuration
Signed-off-by: Rohan Jain <crodjer@gmail.com>
2015-05-15 16:54:38 +05:30
Solly 3371090909 Merge pull request #175 from kanaka/bug/catch-interrupted-syscall
Catch interrupted system call
2015-05-13 16:52:31 -04:00
Bennett Kanuka 1f960d9f3c Catch interrupted system call
Closes #166
2015-05-13 16:15:25 -04:00
Solly Ross 1221960baa 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 2e57ee3159 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 04fd789a67 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 d5216c3166 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 11f9a6cf10 Fix bug in ReadOnlyTokenFile
ReadOnlyTokenFile didn't initialize `self._targets` to `None`,
causing issues.
2015-05-13 16:03:37 -04:00
Solly Ross df10501615 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 d94b944f93 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 52adf957b3 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 731fd20796 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
Solly Ross 52c2e62535 Fix bug in token_plugin/target_cfg support
Previously, if no `target_cfg` flag was used, the `target_cfg` option
would not get removed from the opts dict, causing an error when it got
passed through to `WebSocketProxy`.  Now we always remove it.

Fixes #168.
2015-04-09 11:43:20 -04:00
Solly ac9d357c87 Merge pull request #161 from rafaelfolco/bug/150-websocket-bigendian
BUGFIX:  Websocket frame corruption on big-endian #150
2015-04-07 12:51:52 -04:00
Solly ce07749223 Merge pull request #162 from kanaka/feature/token-plugins
Introduce Token Plugins
2015-04-07 12:51:02 -04:00
Rafael Folco af10f458a1 BUGFIX: Websocket frame corruption on big-endian #150
This patch fixes noVNC endianess problem on handshake.
It affects noVNC sessions on Big Endian platforms.

Fixes #150
2015-04-07 09:36:21 -03:00
Solly Ross 69a8b928aa Introduce Token Plugins
Token plugins provide a generic interface for transforming a token
into a `(host, port)` tuple.

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

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

Token plugins should inherit from `websockify.token_plugins.BasePlugin`,
and should implement the `lookup(token)` method.  The value of the
'--token-source' option is available as `self.source`.

Several plugins are included by default.  The `ReadOnlyTokenFile`
and `TokenFile` plugins implement functionality from '--target-config'
(with the former only reading the file(s) once, and the latter reading
them every time).  The 'BaseTokenAPI' plugin fetches the value from
an API, returning the result of `process_result(response_object)`.
By default, `process_result` simply returns the text of the response,
but may be overriden.  The `JSONTokenAPI` does just this, returning
the 'host' and 'port' values from the response JSON object.

The old '--target-config' option is now deprecated, and maps to the
`TokenFile` plugin under the hood.

Also-Authored-By: James Portman (@james-portman)

Closes #157
2015-03-26 16:21:25 -04:00
Solly 19b558e4cd Merge pull request #159 from vaibhavsagar/python3-trove
Add Python 3 trove classifiers.
2015-03-17 10:32:40 -04:00
Vaibhav Sagar dcdf0a0b6c Add Python 3 trove classifiers.
This makes <http://py3readiness.org> display the status of this package correctly :).
2015-03-17 07:20:26 +11:00
Solly 23045cb212 Merge pull request #155 from kanaka/bug/154-no-implicit-relative-imports
Don't use implicit relative imports
2015-02-06 11:29:57 -05:00
Solly Ross acd276e1a2 Don't use implicit relative imports
Implicit relative imports don't work in Python 3.  This converts
implicit relative imports into absolute imports
(e.g. `import websocket` becomes `from websockify import websocket`).

Fixes #154
2015-02-03 16:52:29 -05:00
Solly 999a133bc5 Merge pull request #128 from ags131/patch-1
Added 'websockify.js' to package.json files list
2015-01-05 12:15:56 -05:00
Joel Martin f36877c684 Merge pull request #140 from rpodgorny/python3
python3 compatibility fixes
2014-10-02 10:02:11 -05:00
Radek Podgorny 303a71310c python3 compatibility fixes 2014-10-02 11:42:17 +02:00
samhed 63209f84ca sync with commit from PR #347 in noVNC 2014-08-19 14:13:00 +02:00
Joel Martin d37e729587 Merge pull request #129 from mmb/master
Fix typo in reaping zombies message.
2014-05-20 18:01:00 -05:00
Matthew M. Boedicker 12191d266b Fix typo in reaping zombies message. 2014-05-20 14:43:35 -07:00
ags131 67a12a2394 Fixed Package.json
Added websockify.js to the files section, this fixes #90 and allows NPM to properly install
2014-05-16 11:56:24 -05:00
samhed 6c526fd645 remove some trailing whitespaces 2014-04-14 14:20:00 +02:00
liyiwei 712e17aaef kill 9 warnings when compile on OS X 10.9 2014-04-07 14:40:27 +08:00
liyiwei e36a59d6a1 add run-once option help message 2014-04-07 12:46:50 +08:00
samhed 6c1a2e9032 Avoid using the %-operator, URL-escaped strings can contain extra %'s which can cause bugs. 2014-03-18 15:21:13 +01:00