From 0a5369944f2616cf6b78e1fa9fad1e0b18dc4ed3 Mon Sep 17 00:00:00 2001 From: Andrea Rocco Lotronto Date: Sat, 21 Feb 2015 11:06:01 +0100 Subject: [PATCH] test for new python version --- .crossbar/node.pid | 16 - .../node_modules/websocket/.jshintrc | 88 - .../node_modules/websocket/CHANGELOG.md | 164 -- .../node_modules/websocket/LICENSE | 177 -- .../node_modules/websocket/Makefile | 11 - .../node_modules/websocket/README.md | 296 --- .../node_modules/websocket/binding.gyp | 16 - .../node_modules/websocket/build/Makefile | 337 --- .../Release/.deps/Release/bufferutil.node.d | 1 - .../Release/obj.target/bufferutil.node.d | 1 - .../obj.target/bufferutil/src/bufferutil.o.d | 29 - .../Release/obj.target/validation.node.d | 1 - .../obj.target/validation/src/validation.o.d | 29 - .../Release/.deps/Release/validation.node.d | 1 - .../websocket/build/Release/bufferutil.node | Bin 18514 -> 0 bytes .../websocket/build/Release/linker.lock | 0 .../build/Release/obj.target/bufferutil.node | Bin 18514 -> 0 bytes .../obj.target/bufferutil/src/bufferutil.o | Bin 13856 -> 0 bytes .../build/Release/obj.target/validation.node | Bin 18448 -> 0 bytes .../obj.target/validation/src/validation.o | Bin 12552 -> 0 bytes .../websocket/build/Release/validation.node | Bin 18448 -> 0 bytes .../websocket/build/binding.Makefile | 6 - .../websocket/build/bufferutil.target.mk | 131 -- .../node_modules/websocket/build/config.gypi | 123 -- .../websocket/build/validation.target.mk | 131 -- .../node_modules/websocket/builderror.log | 0 .../websocket/docs/W3CWebSocket.md | 50 - .../websocket/docs/WebSocketClient.md | 108 - .../websocket/docs/WebSocketConnection.md | 131 -- .../websocket/docs/WebSocketFrame.md | 66 - .../websocket/docs/WebSocketRequest.md | 113 - .../websocket/docs/WebSocketServer.md | 105 - .../node_modules/websocket/docs/index.md | 13 - .../node_modules/websocket/gulpfile.js | 14 - .../node_modules/websocket/index.js | 1 - .../websocket/lib/BufferUtil.fallback.js | 52 - .../node_modules/websocket/lib/BufferUtil.js | 17 - .../node_modules/websocket/lib/Deprecation.js | 32 - .../websocket/lib/Validation.fallback.js | 12 - .../node_modules/websocket/lib/Validation.js | 17 - .../websocket/lib/W3CWebSocket.js | 264 --- .../websocket/lib/WebSocketClient.js | 348 --- .../websocket/lib/WebSocketConnection.js | 858 -------- .../websocket/lib/WebSocketFrame.js | 279 --- .../websocket/lib/WebSocketRequest.js | 524 ----- .../websocket/lib/WebSocketRouter.js | 157 -- .../websocket/lib/WebSocketRouterRequest.js | 54 - .../websocket/lib/WebSocketServer.js | 245 --- .../node_modules/websocket/lib/browser.js | 35 - .../node_modules/websocket/lib/utils.js | 60 - .../node_modules/websocket/lib/version.js | 1 - .../node_modules/websocket/lib/websocket.js | 11 - .../websocket/node_modules/debug/.jshintrc | 3 - .../websocket/node_modules/debug/.npmignore | 6 - .../websocket/node_modules/debug/History.md | 166 -- .../websocket/node_modules/debug/Makefile | 33 - .../websocket/node_modules/debug/Readme.md | 166 -- .../websocket/node_modules/debug/bower.json | 28 - .../websocket/node_modules/debug/browser.js | 158 -- .../node_modules/debug/component.json | 19 - .../websocket/node_modules/debug/debug.js | 197 -- .../websocket/node_modules/debug/node.js | 209 -- .../debug/node_modules/ms/.npmignore | 5 - .../debug/node_modules/ms/README.md | 33 - .../debug/node_modules/ms/index.js | 111 - .../debug/node_modules/ms/package.json | 43 - .../websocket/node_modules/debug/package.json | 72 - .../websocket/node_modules/nan/.dntrc | 36 - .../websocket/node_modules/nan/LICENSE | 46 - .../websocket/node_modules/nan/README.md | 947 -------- .../node_modules/nan/build/config.gypi | 38 - .../node_modules/nan/include_dirs.js | 1 - .../websocket/node_modules/nan/nan.h | 1910 ----------------- .../websocket/node_modules/nan/package.json | 68 - .../typedarray-to-buffer/.travis.yml | 7 - .../typedarray-to-buffer/.zuul.yml | 18 - .../node_modules/typedarray-to-buffer/LICENSE | 21 - .../typedarray-to-buffer/README.md | 78 - .../typedarray-to-buffer/index.js | 31 - .../node_modules/is-typedarray/LICENSE.md | 18 - .../node_modules/is-typedarray/README.md | 16 - .../node_modules/is-typedarray/index.js | 39 - .../node_modules/is-typedarray/package.json | 54 - .../node_modules/is-typedarray/test.js | 34 - .../typedarray-to-buffer/package.json | 75 - .../typedarray-to-buffer/test/basic.js | 52 - .../node_modules/websocket/package.json | 80 - .../node_modules/websocket/src/bufferutil.cc | 117 - .../node_modules/websocket/src/validation.cc | 145 -- .../websocket/vendor/FastBufferList.js | 192 -- s4t-server-python/s4t-wamp-server.py | 67 +- ...test_3.py => test_autobahn_wamp_client.py} | 47 +- .../{test_2.py => test_autobahn_ws_client.py} | 2 +- .../{test_s.py => test_autobahn_ws_server.py} | 0 s4t-server-python/{test_c_W.py => yooo.py} | 28 +- s4t-server-python/yos4t-wamp-server.py | 125 -- 96 files changed, 105 insertions(+), 10561 deletions(-) delete mode 100644 .crossbar/node.pid delete mode 100644 s4t-server-python/node_modules/websocket/.jshintrc delete mode 100644 s4t-server-python/node_modules/websocket/CHANGELOG.md delete mode 100644 s4t-server-python/node_modules/websocket/LICENSE delete mode 100644 s4t-server-python/node_modules/websocket/Makefile delete mode 100644 s4t-server-python/node_modules/websocket/README.md delete mode 100644 s4t-server-python/node_modules/websocket/binding.gyp delete mode 100644 s4t-server-python/node_modules/websocket/build/Makefile delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/bufferutil.node.d delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil.node.d delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation.node.d delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation/src/validation.o.d delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/.deps/Release/validation.node.d delete mode 100755 s4t-server-python/node_modules/websocket/build/Release/bufferutil.node delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/linker.lock delete mode 100755 s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil.node delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil/src/bufferutil.o delete mode 100755 s4t-server-python/node_modules/websocket/build/Release/obj.target/validation.node delete mode 100644 s4t-server-python/node_modules/websocket/build/Release/obj.target/validation/src/validation.o delete mode 100755 s4t-server-python/node_modules/websocket/build/Release/validation.node delete mode 100644 s4t-server-python/node_modules/websocket/build/binding.Makefile delete mode 100644 s4t-server-python/node_modules/websocket/build/bufferutil.target.mk delete mode 100644 s4t-server-python/node_modules/websocket/build/config.gypi delete mode 100644 s4t-server-python/node_modules/websocket/build/validation.target.mk delete mode 100644 s4t-server-python/node_modules/websocket/builderror.log delete mode 100644 s4t-server-python/node_modules/websocket/docs/W3CWebSocket.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/WebSocketClient.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/WebSocketConnection.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/WebSocketFrame.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/WebSocketRequest.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/WebSocketServer.md delete mode 100644 s4t-server-python/node_modules/websocket/docs/index.md delete mode 100644 s4t-server-python/node_modules/websocket/gulpfile.js delete mode 100644 s4t-server-python/node_modules/websocket/index.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/BufferUtil.fallback.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/BufferUtil.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/Deprecation.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/Validation.fallback.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/Validation.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/W3CWebSocket.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketClient.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketConnection.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketFrame.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketRequest.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketRouter.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketRouterRequest.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/WebSocketServer.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/browser.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/utils.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/version.js delete mode 100644 s4t-server-python/node_modules/websocket/lib/websocket.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/.jshintrc delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/.npmignore delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/History.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/Makefile delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/Readme.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/bower.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/browser.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/component.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/debug.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/node.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/.npmignore delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/README.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/index.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/package.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/debug/package.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/.dntrc delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/LICENSE delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/README.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/build/config.gypi delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/include_dirs.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/nan.h delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/nan/package.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.travis.yml delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.zuul.yml delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/LICENSE delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/README.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/index.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/LICENSE.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/README.md delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/package.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/test.js delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/package.json delete mode 100644 s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/test/basic.js delete mode 100644 s4t-server-python/node_modules/websocket/package.json delete mode 100644 s4t-server-python/node_modules/websocket/src/bufferutil.cc delete mode 100644 s4t-server-python/node_modules/websocket/src/validation.cc delete mode 100644 s4t-server-python/node_modules/websocket/vendor/FastBufferList.js rename s4t-server-python/{test_3.py => test_autobahn_wamp_client.py} (77%) rename s4t-server-python/{test_2.py => test_autobahn_ws_client.py} (98%) rename s4t-server-python/{test_s.py => test_autobahn_ws_server.py} (100%) rename s4t-server-python/{test_c_W.py => yooo.py} (81%) delete mode 100644 s4t-server-python/yos4t-wamp-server.py diff --git a/.crossbar/node.pid b/.crossbar/node.pid deleted file mode 100644 index a8bb68e..0000000 --- a/.crossbar/node.pid +++ /dev/null @@ -1,16 +0,0 @@ -{ - "pid": 7807, - "options": { - "loglevel": "info", - "logdir": null, - "config": "/mnt/Data-Partition/Develop/GitRepository/GitHub/MDSLab/iotronic/.crossbar/config.json", - "cbdir": "/mnt/Data-Partition/Develop/GitRepository/GitHub/MDSLab/iotronic/.crossbar", - "command": "start", - "reactor": null, - "debug": false - }, - "argv": [ - "/mnt/Data-Partition/IoT-Communication/pypy-2.4.0-linux/bin/crossbar", - "start" - ] -} diff --git a/s4t-server-python/node_modules/websocket/.jshintrc b/s4t-server-python/node_modules/websocket/.jshintrc deleted file mode 100644 index 98d8766..0000000 --- a/s4t-server-python/node_modules/websocket/.jshintrc +++ /dev/null @@ -1,88 +0,0 @@ -{ - // JSHint Default Configuration File (as on JSHint website) - // See http://jshint.com/docs/ for more details - - "maxerr" : 50, // {int} Maximum error before stopping - - // Enforcing - "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase" : false, // true: Identifiers must be in camelCase - "curly" : true, // true: Require {} for every new block or scope - "eqeqeq" : true, // true: Require triple equals (===) for comparison - "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. - "forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty() - "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "latedef" : "nofunc", // true: Require variables/functions to be defined before being used - "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty" : true, // true: Prohibit use of empty blocks - "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. - "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus" : false, // true: Prohibit use of `++` & `--` - "quotmark" : "single", // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused" : "vars", // vars: Require all defined variables be used, ignore function params - "strict" : false, // true: Requires all functions run in ES5 Strict Mode - "maxparams" : false, // {int} Max number of formal params allowed per function - "maxdepth" : false, // {int} Max depth of nested blocks (within functions) - "maxstatements" : false, // {int} Max number statements per function - "maxcomplexity" : false, // {int} Max cyclomatic complexity per function - "maxlen" : false, // {int} Max number of characters per line - - // Relaxing - "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss" : false, // true: Tolerate assignments where comparisons would be expected - "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // true: Tolerate use of `== null` - "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) - "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) - "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - // (ex: `for each`, multiple try/catch, function expression…) - "evil" : false, // true: Tolerate use of `eval` and `new Function()` - "expr" : false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope" : false, // true: Tolerate defining variables inside control statements - "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') - "iterator" : false, // true: Tolerate using the `__iterator__` property - "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak" : false, // true: Tolerate possibly unsafe line breakings - "laxcomma" : false, // true: Tolerate comma-first style coding - "loopfunc" : false, // true: Tolerate functions being defined in loops - "multistr" : false, // true: Tolerate multi-line strings - "noyield" : false, // true: Tolerate generator functions with no yield statement in them. - "notypeof" : false, // true: Tolerate invalid typeof operator values - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub" : true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis" : false, // true: Tolerate using this in a non-constructor function - - // Environments - "browser" : true, // Web Browser (window, document, etc) - "browserify" : true, // Browserify (node.js code in the browser) - "couch" : false, // CouchDB - "devel" : true, // Development/debugging (alert, confirm, etc) - "dojo" : false, // Dojo Toolkit - "jasmine" : false, // Jasmine - "jquery" : false, // jQuery - "mocha" : false, // Mocha - "mootools" : false, // MooTools - "node" : true, // Node.js - "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) - "prototypejs" : false, // Prototype and Scriptaculous - "qunit" : false, // QUnit - "rhino" : false, // Rhino - "shelljs" : false, // ShellJS - "worker" : false, // Web Workers - "wsh" : false, // Windows Scripting Host - "yui" : false, // Yahoo User Interface - - // Custom Globals - "globals" : { // additional predefined global variables - "WebSocket": true - } -} diff --git a/s4t-server-python/node_modules/websocket/CHANGELOG.md b/s4t-server-python/node_modules/websocket/CHANGELOG.md deleted file mode 100644 index aca2aa1..0000000 --- a/s4t-server-python/node_modules/websocket/CHANGELOG.md +++ /dev/null @@ -1,164 +0,0 @@ -Changelog -========= - -Version 1.0.17 --------------- -*Released 2015-01-17* - -* Resolves [issue #179](https://github.com/theturtle32/WebSocket-Node/pull/179) - Allow toBuffer to work with empty data - - -Version 1.0.16 --------------- -*Released 2015-01-16* - -* Resolves [issue #178](https://github.com/theturtle32/WebSocket-Node/issues/178) - Ping Frames with no data - - -Version 1.0.15 --------------- -*Released 2015-01-13* - -* Resolves [issue #177](https://github.com/theturtle32/WebSocket-Node/issues/177) - WebSocketClient ignores options unless it has a tlsOptions property - - -Version 1.0.14 --------------- -*Released 2014-12-03* - -* Resolves [issue #173](https://github.com/theturtle32/WebSocket-Node/issues/173) - To allow the W3CWebSocket interface to accept an optional non-standard configuration object as its third parameter, which will be ignored when running in a browser context. - - -Version 1.0.13 --------------- -*Released 2014-11-29* - -* Fixes [issue #171](https://github.com/theturtle32/WebSocket-Node/issues/171) - Code to prevent calling req.accept/req.reject multiple times breaks sanity checks in req.accept - - -Version 1.0.12 --------------- -*Released 2014-11-28* - -* Fixes [issue #170](https://github.com/theturtle32/WebSocket-Node/issues/170) - Non-native XOR implementation broken after making JSHint happy - - -Version 1.0.11 --------------- -*Released 2014-11-25* - -* Fixes some undefined behavior surrounding closing WebSocket connections and more reliably handles edge cases. -* Adds an implementation of the W3C WebSocket API for browsers to facilitate sharing code between client and server via browserify. (Thanks, [@ibc](https://github.com/ibc)!) -* `WebSocketConnection.prototype.close` now accepts optional `reasonCode` and `description` parameters. -* Calling `accept` or `reject` more than once on a `WebSocketRequest` will now throw an error. [Issue #149](https://github.com/theturtle32/WebSocket-Node/issues/149) -* Handling connections dropped by client before accepted by server [Issue #167](https://github.com/theturtle32/WebSocket-Node/issues/167) -* Integrating Gulp and JSHint (Thanks, [@ibc](https://github.com/ibc)!) -* Starting to add individual unit tests (using substack's [tape](github.com/substack/tape) and [faucet](github.com/substack/faucet)) - - -Version 1.0.10 --------------- -*Released 2014-10-22* - -* Fixed Issue [#146](https://github.com/theturtle32/WebSocket-Node/issues/146) that was causing WebSocketClient to throw errors when instantiated if passed `tlsOptions`. - -Version 1.0.9 -------------- -*Released 2014-10-20* - -* Fixing an insidious corner-case bug that prevented `WebSocketConnection` from firing the `close` event in certain cases when there was an error on the underlying `Socket`, leading to connections sticking around forever, stuck erroneously in the `connected` state. These "ghost" connections would cause an error event when trying to write to them. -* Removed deprecated `websocketVersion` property. Use `webSocketVersion` instead (case difference). -* Allowing user to specify all properties for `tlsOptions` in WebSocketClient, not just a few whitelisted properties. This keeps us from having to constantly add new config properties for new versions of Node. (Thanks, [jesusprubio](https://github.com/jesusprubio)) -* Removing support for Node 0.4.x and 0.6.x. -* Adding `fuzzingclient.json` spec file for the Autobahn Test Suite. -* Now more fairly emitting `message` events from the `WebSocketConnection`. Previously, all buffered frames for a connection would be processed and all `message` events emitted before moving on to processing the next connection with available data. Now We process one frame per connection (most of the time) in a more fair round-robin fashion. -* Now correctly calling the `EventEmitter` superclass constructor during class instance initialization. -* `WebSocketClient.prototype.connect` now accepts the empty string (`''`) to mean "no subprotocol requested." Previously either `null` or an empty array (`[]`) was required. -* Fixing a `TypeError` bug in `WebSocketRouter` (Thanks, [a0000778](https://github.com/a0000778)) -* Fixing a potential race condition when attaching event listeners to the underlying `Socket`. (Thanks [RichardBsolut](https://github.com/RichardBsolut)) -* `WebSocketClient` now accepts an optional options hash to be passed to `(http|https).request`. (Thanks [mildred](https://github.com/mildred) and [aus](https://github.com/aus)) This enables the following new abilities, amongst others: - * Use WebSocket-Node from behind HTTP/HTTPS proxy servers using [koichik/node-tunnel](https://github.com/koichik/node-tunnel) or similar. - * Specify the local port and local address to bind the outgoing request socket to. -* Adding option to ignore `X-Forwarded-For` headers when accepting connections from untrusted clients. -* Adding ability to mount a `WebSocketServer` instance to an arbitrary number of Node http/https servers. -* Adding browser shim so Browserify won't blow up when trying to package up code that uses WebSocket-Node. The shim is a no-op, it ***does not implement a wrapper*** providing the WebSocket-Node API in the browser. -* Incorporating upstream enhancements for the native C++ UTF-8 validation and xor masking functions. (Thanks [einaros](https://github.com/einaros) and [kkoopa](https://github.com/kkoopa)) - - -Version 1.0.8 -------------- -*Released 2012-12-26* - -* Fixed remaining naming inconsistency of "websocketVersion" as opposed to "webSocketVersion" throughout the code, and added deprecation warnings for use of the old casing throughout. -* Fixed an issue with our case-insensitive handling of WebSocket subprotocols. Clients that requested a mixed-case subprotocol would end up failing the connection when the server accepted the connection, returning a lower-case version of the subprotocol name. Now we return the subprotocol name in the exact casing that was requested by the client, while still maintaining the case-insensitive verification logic for convenience and practicality. -* Making sure that any socket-level activity timeout that may have been set on a TCP socket is removed when initializing a connection. -* Added support for native TCP Keep-Alive instead of using the WebSocket ping/pong packets to serve that function. -* Fixed cookie parsing to be compliant with RFC 2109 - -Version 1.0.7 -------------- -*Released 2012-08-12* - -* ***Native modules are now optional!*** If they fail to compile, WebSocket-Node will still work but will not verify that received UTF-8 data is valid, and xor masking/unmasking of payload data for security purposes will not be as efficient as it is performed in JavaScript instead of native code. -* Reduced Node.JS version requirement back to v0.6.10 - -Version 1.0.6 -------------- -*Released 2012-05-22* - -* Now requires Node v0.6.13 since that's the first version that I can manage to successfully build the native UTF-8 validator with node-gyp through npm. - -Version 1.0.5 -------------- -*Released 2012-05-21* - -* Fixes the issues that users were having building the native UTF-8 validator on Windows platforms. Special Thanks to: - * [zerodivisi0n](https://github.com/zerodivisi0n) - * [andreasbotsikas](https://github.com/andreasbotsikas) -* Fixed accidental global variable usage (Thanks, [hakobera](https://github.com/hakobera)!) -* Added callbacks to the send* methods that provide notification of messages being sent on the wire and any socket errors that may occur when sending a message. (Thanks, [zerodivisi0n](https://github.com/zerodivisi0n)!) -* Added option to disable logging in the echo-server in the test folder (Thanks, [oberstet](https://github.com/oberstet)!) - - -Version 1.0.4 -------------- -*Released 2011-12-18* - -* Now validates that incoming UTF-8 messages do, in fact, contain valid UTF-8 data. The connection is dropped with prejudice if invalid data is received. This strict behavior conforms to the WebSocket RFC and is verified by the Autobahn Test Suite. This is accomplished in a performant way by using a native C++ Node module created by [einaros](https://github.com/einaros). -* Updated handling of connection closure to pass more of the Autobahn Test Suite. - -Version 1.0.3 -------------- -*Released 2011-12-18* - -* Substantial speed increase (~150% on my machine, depending on the circumstances) due to an optimization in FastBufferList.js that drastically reduces the number of memory alloctions and buffer copying. ([kazuyukitanimura](https://github.com/kazuyukitanimura)) - - -Version 1.0.2 -------------- -*Released 2011-11-28* - -* Fixing whiteboard example to work under Node 0.6.x ([theturtle32](https://github.com/theturtle32)) -* Now correctly emitting a `close` event with a 1006 error code if there is a TCP error while writing to the socket during the handshake. ([theturtle32](https://github.com/theturtle32)) -* Catching errors when writing to the TCP socket during the handshake. ([justoneplanet](https://github.com/justoneplanet)) -* No longer outputting console.warn messages when there is an error writing to the TCP socket ([justoneplanet](https://github.com/justoneplanet)) -* Fixing some formatting errors, commas, semicolons, etc. ([kaisellgren](https://github.com/kaisellgren)) - - -Version 1.0.1 -------------- -*Released 2011-11-21* - -* Now works with Node 0.6.2 as well as 0.4.12 -* Support TLS in WebSocketClient -* Added support for setting and reading cookies -* Added WebSocketServer.prototype.broadcast(data) convenience method -* Added `resourceURL` property to WebSocketRequest objects. It is a Node URL object with the `resource` and any query string params already parsed. -* The WebSocket request router no longer includes the entire query string when trying to match the path name of the request. -* WebSocketRouterRequest objects now include all the properties and events of WebSocketRequest objects. -* Removed more console.log statements. Please rely on the various events emitted to be notified of error conditions. I decided that it is not a library's place to spew information to the console. -* Renamed the `websocketVersion` property to `webSocketVersion` throughout the code to fix inconsistent capitalization. `websocketVersion` has been kept for compatibility but is deprecated and may be removed in the future. -* Now outputting the sanitized version of custom header names rather than the raw value. This prevents invalid HTTP from being put onto the wire if given an illegal header name. - - -I decided it's time to start maintaining a changelog now, starting with version 1.0.1. diff --git a/s4t-server-python/node_modules/websocket/LICENSE b/s4t-server-python/node_modules/websocket/LICENSE deleted file mode 100644 index 430d42b..0000000 --- a/s4t-server-python/node_modules/websocket/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/s4t-server-python/node_modules/websocket/Makefile b/s4t-server-python/node_modules/websocket/Makefile deleted file mode 100644 index 39ff645..0000000 --- a/s4t-server-python/node_modules/websocket/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -all: - node-gyp configure build - -clean: - node-gyp clean - -autobahn: - @NODE_PATH=lib node test/autobahn-test-client.js --host=127.0.0.1 --port=9000 - -autobahn-server: - @NODE_PATH=lib node test/echo-server.js diff --git a/s4t-server-python/node_modules/websocket/README.md b/s4t-server-python/node_modules/websocket/README.md deleted file mode 100644 index ada448c..0000000 --- a/s4t-server-python/node_modules/websocket/README.md +++ /dev/null @@ -1,296 +0,0 @@ -WebSocket Client & Server Implementation for Node -================================================= - -[![npm version](https://badge.fury.io/js/websocket.svg)](http://badge.fury.io/js/websocket) - -[![NPM](https://nodei.co/npm/websocket.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/websocket/) - -[![NPM](https://nodei.co/npm-dl/websocket.png?height=3)](https://nodei.co/npm/websocket/) - -Overview --------- -This is a (mostly) pure JavaScript implementation of the WebSocket protocol versions 8 and 13 for Node. There are some example client and server applications that implement various interoperability testing protocols in the "test/scripts" folder. - -For a WebSocket client written in ActionScript 3, see my [AS3WebScocket](https://github.com/theturtle32/AS3WebSocket) project. - - -Documentation -============= - -[You can read the full API documentation in the docs folder.](docs/index.md) - - -Changelog ---------- - -***Current Version: 1.0.17*** — Released 2015-01-17 - -***Version 1.0.17*** - -* Resolves [issue #179](https://github.com/theturtle32/WebSocket-Node/pull/179) - Allow toBuffer to work with empty data - -***Version 1.0.16*** - -* Resolves [issue #178](https://github.com/theturtle32/WebSocket-Node/issues/178) - Ping Frames with no data - -***Version 1.0.15*** - -* Resolves [issue #177](https://github.com/theturtle32/WebSocket-Node/issues/177) - WebSocketClient ignores options unless it has a tlsOptions property - -***Version 1.0.14*** - -* Resolves [issue #173](https://github.com/theturtle32/WebSocket-Node/issues/173) - To allow the W3CWebSocket interface to accept an optional non-standard configuration object as its third parameter, which will be ignored when running in a browser context. - - -[View the full changelog](CHANGELOG.md) - -Browser Support ---------------- - -All current browsers are fully supported. - -* Firefox 7-9 (Old) (Protocol Version 8) -* Firefox 10+ (Protocol Version 13) -* Chrome 14,15 (Old) (Protocol Version 8) -* Chrome 16+ (Protocol Version 13) -* Internet Explorer 10+ (Protocol Version 13) -* Safari 6+ (Protocol Version 13) - -***Safari older than 6.0 is not supported since it uses a very old draft of WebSockets*** - -***If you need to simultaneously support legacy browser versions that had implemented draft-75/draft-76/draft-00, take a look here: https://gist.github.com/1428579*** - -Benchmarks ----------- -There are some basic benchmarking sections in the Autobahn test suite. I've put up a [benchmark page](http://theturtle32.github.com/WebSocket-Node/benchmarks/) that shows the results from the Autobahn tests run against AutobahnServer 0.4.10, WebSocket-Node 1.0.2, WebSocket-Node 1.0.4, and ws 0.3.4. - -Autobahn Tests --------------- -The very complete [Autobahn Test Suite](http://autobahn.ws/testsuite/) is used by most WebSocket implementations to test spec compliance and interoperability. - -- [View Server Test Results](http://theturtle32.github.com/WebSocket-Node/test-report/servers/) -- [View Client Test Results](http://theturtle32.github.com/WebSocket-Node/test-report/clients/) - -Notes ------ -This library has been used in production on [worlize.com](https://www.worlize.com) since April 2011 and seems to be stable. Your mileage may vary. - -**Tested with the following node versions:** - -- 0.8.28 -- 0.10.33 - -It may work in earlier or later versions but I'm not actively testing it outside of the listed versions. YMMV. - -Installation ------------- - -A few users have reported difficulties building the native extensions without first manually installing node-gyp. If you have trouble building the native extensions, make sure you've got a C++ compiler, and have done `npm install -g node-gyp` first. - -Native extensions are optional, however, and WebSocket-Node will work even if the extensions cannot be compiled. - -In your project root: - - $ npm install websocket - -Then in your code: - -```javascript -var WebSocketServer = require('websocket').server; -var WebSocketClient = require('websocket').client; -var WebSocketFrame = require('websocket').frame; -var WebSocketRouter = require('websocket').router; -var W3CWebSocket = require('websocket').w3cwebsocket; -``` - -Note for Windows Users ----------------------- -Because there is a small C++ component used for validating UTF-8 data, you will need to install a few other software packages in addition to Node to be able to build this module: - -- [Microsoft Visual C++](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express) -- [Python 2.7](http://www.python.org/download/) (NOT Python 3.x) - - -Current Features: ------------------ -- Licensed under the Apache License, Version 2.0 -- Protocol version "8" and "13" (Draft-08 through the final RFC) framing and handshake -- Can handle/aggregate received fragmented messages -- Can fragment outgoing messages -- Router to mount multiple applications to various path and protocol combinations -- TLS supported for outbound connections via WebSocketClient -- TLS supported for server connections (use https.createServer instead of http.createServer) - - Thanks to [pors](https://github.com/pors) for confirming this! -- Cookie setting and parsing -- Tunable settings - - Max Receivable Frame Size - - Max Aggregate ReceivedMessage Size - - Whether to fragment outgoing messages - - Fragmentation chunk size for outgoing messages - - Whether to automatically send ping frames for the purposes of keepalive - - Keep-alive ping interval - - Whether or not to automatically assemble received fragments (allows application to handle individual fragments directly) - - How long to wait after sending a close frame for acknowledgment before closing the socket. -- [W3C WebSocket API](http://www.w3.org/TR/websockets/) for applications running on both Node and browsers (via the `W3CWebSocket` class). - - -Known Issues/Missing Features: ------------------------------- -- No API for user-provided protocol extensions. - - -Usage Examples -============== - -Server Example --------------- - -Here's a short example showing a server that echos back anything sent to it, whether utf-8 or binary. - -```javascript -#!/usr/bin/env node -var WebSocketServer = require('websocket').server; -var http = require('http'); - -var server = http.createServer(function(request, response) { - console.log((new Date()) + ' Received request for ' + request.url); - response.writeHead(404); - response.end(); -}); -server.listen(8080, function() { - console.log((new Date()) + ' Server is listening on port 8080'); -}); - -wsServer = new WebSocketServer({ - httpServer: server, - // You should not use autoAcceptConnections for production - // applications, as it defeats all standard cross-origin protection - // facilities built into the protocol and the browser. You should - // *always* verify the connection's origin and decide whether or not - // to accept it. - autoAcceptConnections: false -}); - -function originIsAllowed(origin) { - // put logic here to detect whether the specified origin is allowed. - return true; -} - -wsServer.on('request', function(request) { - if (!originIsAllowed(request.origin)) { - // Make sure we only accept requests from an allowed origin - request.reject(); - console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.'); - return; - } - - var connection = request.accept('echo-protocol', request.origin); - console.log((new Date()) + ' Connection accepted.'); - connection.on('message', function(message) { - if (message.type === 'utf8') { - console.log('Received Message: ' + message.utf8Data); - connection.sendUTF(message.utf8Data); - } - else if (message.type === 'binary') { - console.log('Received Binary Message of ' + message.binaryData.length + ' bytes'); - connection.sendBytes(message.binaryData); - } - }); - connection.on('close', function(reasonCode, description) { - console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.'); - }); -}); -``` - -Client Example --------------- - -This is a simple example client that will print out any utf-8 messages it receives on the console, and periodically sends a random number. - -*This code demonstrates a client in Node.js, not in the browser* - -```javascript -#!/usr/bin/env node -var WebSocketClient = require('websocket').client; - -var client = new WebSocketClient(); - -client.on('connectFailed', function(error) { - console.log('Connect Error: ' + error.toString()); -}); - -client.on('connect', function(connection) { - console.log('WebSocket Client Connected'); - connection.on('error', function(error) { - console.log("Connection Error: " + error.toString()); - }); - connection.on('close', function() { - console.log('echo-protocol Connection Closed'); - }); - connection.on('message', function(message) { - if (message.type === 'utf8') { - console.log("Received: '" + message.utf8Data + "'"); - } - }); - - function sendNumber() { - if (connection.connected) { - var number = Math.round(Math.random() * 0xFFFFFF); - connection.sendUTF(number.toString()); - setTimeout(sendNumber, 1000); - } - } - sendNumber(); -}); - -client.connect('ws://localhost:8080/', 'echo-protocol'); -``` - -Client Example using the *W3C WebSocket API* --------------------------------------------- - -Same example as above but using the [W3C WebSocket API](http://www.w3.org/TR/websockets/). - -```javascript -var W3CWebSocket = require('websocket').w3cwebsocket; - -var client = new W3CWebSocket('ws://localhost:8080/', 'echo-protocol'); - -client.onerror = function() { - console.log('Connection Error'); -}; - -client.onopen = function() { - console.log('WebSocket Client Connected'); - - function sendNumber() { - if (client.readyState === client.OPEN) { - var number = Math.round(Math.random() * 0xFFFFFF); - client.send(number.toString()); - setTimeout(sendNumber, 1000); - } - } - sendNumber(); -}; - -client.onclose = function() { - console.log('echo-protocol Client Closed'); -}; - -client.onmessage = function(e) { - if (typeof e.data === 'string') { - console.log("Received: '" + e.data + "'"); - } -}; -``` - -Request Router Example ----------------------- - -For an example of using the request router, see `libwebsockets-test-server.js` in the `test` folder. - - -Resources ---------- - -A presentation on the state of the WebSockets protocol that I gave on July 23, 2011 at the LA Hacker News meetup. [WebSockets: The Real-Time Web, Delivered](http://www.scribd.com/doc/60898569/WebSockets-The-Real-Time-Web-Delivered) diff --git a/s4t-server-python/node_modules/websocket/binding.gyp b/s4t-server-python/node_modules/websocket/binding.gyp deleted file mode 100644 index 600f9d1..0000000 --- a/s4t-server-python/node_modules/websocket/binding.gyp +++ /dev/null @@ -1,16 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'validation', - 'include_dirs': ["> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef - -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< - -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = rm -rf "$@" && cp -af "$<" "$@" - -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) - -# We support two kinds of shared objects (.so): -# 1) shared_library, which is just bundling together many dependent libraries -# into a link line. -# 2) loadable_module, which is generating a module intended for dlopen(). -# -# They differ only slightly: -# In the former case, we want to package all dependent code into the .so. -# In the latter case, we want to package just the API exposed by the -# outermost module. -# This means shared_library uses --whole-archive, while loadable_module doesn't. -# (Note that --whole-archive is incompatible with the --start-group used in -# normal linking.) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) - - -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' - -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain ? instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\ - for p in $(POSTBUILDS); do\ - eval $$p;\ - E=$$?;\ - if [ $$E -ne 0 ]; then\ - break;\ - fi;\ - done;\ - if [ $$E -ne 0 ]; then\ - rm -rf "$@";\ - exit $$E;\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains ? for -# spaces already and dirx strips the ? characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word 1,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "all" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: all -all: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -TOOLSET := target -# Suffix rules, putting all outputs into $(obj). -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - -# Try building from generated source, too. -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - -$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) - - -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,bufferutil.target.mk)))),) - include bufferutil.target.mk -endif -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,validation.target.mk)))),) - include validation.target.mk -endif - -quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/mnt/Data-Partition/Develop/GitRepository/GitHub/MDSLab/iotronic/s4t-server-python/node_modules/websocket/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/andrea/.node-gyp/0.10.35/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/andrea/.node-gyp/0.10.35" "-Dmodule_root_dir=/mnt/Data-Partition/Develop/GitRepository/GitHub/MDSLab/iotronic/s4t-server-python/node_modules/websocket" binding.gyp -Makefile: $(srcdir)/../../../../../../../../../../home/andrea/.node-gyp/0.10.35/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi - $(call do_cmd,regen_makefile) - -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/bufferutil.node.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/bufferutil.node.d deleted file mode 100644 index 03982be..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/bufferutil.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/bufferutil.node := rm -rf "Release/bufferutil.node" && cp -af "Release/obj.target/bufferutil.node" "Release/bufferutil.node" diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil.node.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil.node.d deleted file mode 100644 index 64d1dc1..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/obj.target/bufferutil.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m32 -Wl,-soname=bufferutil.node -o Release/obj.target/bufferutil.node -Wl,--start-group Release/obj.target/bufferutil/src/bufferutil.o -Wl,--end-group diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d deleted file mode 100644 index 35513d9..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d +++ /dev/null @@ -1,29 +0,0 @@ -cmd_Release/obj.target/bufferutil/src/bufferutil.o := g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/andrea/.node-gyp/0.10.35/src -I/home/andrea/.node-gyp/0.10.35/deps/uv/include -I/home/andrea/.node-gyp/0.10.35/deps/v8/include -I../node_modules/nan -Wall -Wextra -Wno-unused-parameter -pthread -m32 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw -c -o Release/obj.target/bufferutil/src/bufferutil.o ../src/bufferutil.cc -Release/obj.target/bufferutil/src/bufferutil.o: ../src/bufferutil.cc \ - /home/andrea/.node-gyp/0.10.35/deps/v8/include/v8.h \ - /home/andrea/.node-gyp/0.10.35/deps/v8/include/v8stdint.h \ - /home/andrea/.node-gyp/0.10.35/src/node.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-unix.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/ngx-queue.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-linux.h \ - /home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h \ - /home/andrea/.node-gyp/0.10.35/src/node.h \ - /home/andrea/.node-gyp/0.10.35/src/node_buffer.h \ - /home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h \ - ../node_modules/nan/nan.h \ - /home/andrea/.node-gyp/0.10.35/src/node_version.h -../src/bufferutil.cc: -/home/andrea/.node-gyp/0.10.35/deps/v8/include/v8.h: -/home/andrea/.node-gyp/0.10.35/deps/v8/include/v8stdint.h: -/home/andrea/.node-gyp/0.10.35/src/node.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-unix.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/ngx-queue.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-linux.h: -/home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h: -/home/andrea/.node-gyp/0.10.35/src/node.h: -/home/andrea/.node-gyp/0.10.35/src/node_buffer.h: -/home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h: -../node_modules/nan/nan.h: -/home/andrea/.node-gyp/0.10.35/src/node_version.h: diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation.node.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation.node.d deleted file mode 100644 index 97d7984..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/obj.target/validation.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m32 -Wl,-soname=validation.node -o Release/obj.target/validation.node -Wl,--start-group Release/obj.target/validation/src/validation.o -Wl,--end-group diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation/src/validation.o.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation/src/validation.o.d deleted file mode 100644 index a507a1f..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/obj.target/validation/src/validation.o.d +++ /dev/null @@ -1,29 +0,0 @@ -cmd_Release/obj.target/validation/src/validation.o := g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/andrea/.node-gyp/0.10.35/src -I/home/andrea/.node-gyp/0.10.35/deps/uv/include -I/home/andrea/.node-gyp/0.10.35/deps/v8/include -I../node_modules/nan -Wall -Wextra -Wno-unused-parameter -pthread -m32 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/validation/src/validation.o.d.raw -c -o Release/obj.target/validation/src/validation.o ../src/validation.cc -Release/obj.target/validation/src/validation.o: ../src/validation.cc \ - /home/andrea/.node-gyp/0.10.35/deps/v8/include/v8.h \ - /home/andrea/.node-gyp/0.10.35/deps/v8/include/v8stdint.h \ - /home/andrea/.node-gyp/0.10.35/src/node.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-unix.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/ngx-queue.h \ - /home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-linux.h \ - /home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h \ - /home/andrea/.node-gyp/0.10.35/src/node.h \ - /home/andrea/.node-gyp/0.10.35/src/node_buffer.h \ - /home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h \ - ../node_modules/nan/nan.h \ - /home/andrea/.node-gyp/0.10.35/src/node_version.h -../src/validation.cc: -/home/andrea/.node-gyp/0.10.35/deps/v8/include/v8.h: -/home/andrea/.node-gyp/0.10.35/deps/v8/include/v8stdint.h: -/home/andrea/.node-gyp/0.10.35/src/node.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-unix.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/ngx-queue.h: -/home/andrea/.node-gyp/0.10.35/deps/uv/include/uv-private/uv-linux.h: -/home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h: -/home/andrea/.node-gyp/0.10.35/src/node.h: -/home/andrea/.node-gyp/0.10.35/src/node_buffer.h: -/home/andrea/.node-gyp/0.10.35/src/node_object_wrap.h: -../node_modules/nan/nan.h: -/home/andrea/.node-gyp/0.10.35/src/node_version.h: diff --git a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/validation.node.d b/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/validation.node.d deleted file mode 100644 index 6b32ade..0000000 --- a/s4t-server-python/node_modules/websocket/build/Release/.deps/Release/validation.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/validation.node := rm -rf "Release/validation.node" && cp -af "Release/obj.target/validation.node" "Release/validation.node" diff --git a/s4t-server-python/node_modules/websocket/build/Release/bufferutil.node b/s4t-server-python/node_modules/websocket/build/Release/bufferutil.node deleted file mode 100755 index 1b5f4072facd71ffb98197e0a6894be399b1e5e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18514 zcmeHP4|JSWm4A~7Wgwv`*p?zyr)|I%+G!?9)1*|KG@X<{Qeu;oYONoWWSXQ+GGX#f z+CmF0)36=K)CkqXF6&wkF5)h(x&m7j*OXSuzr~Em&Laa=C;_Zs8WhhNcQp3K;M!N~!RQbH!XS zQ(PkHhM#ceJeAKOGDS%G5uXr8u2#7g0_%|{X?hOeanO&0&MYfvdM;4rslZJx1kP+| z^}n%O_gyB0$$LO!HuR5x4s={%`%q7;0^O;f7i}@KK7eW;(2cxeWs~?~^yd3!d}Z3q z1y?q2TK_uZCyR%} zKmFQsH?5iZ$DO~w`#ZnBbL)Mt|Elov_Fw;VdH>y8tAam1?!GqX=RYX<*SDVd-rkpP z+;_5Q?xTel`Y!+7f30Xgc#m!-1+HW#bfS&UqcLDnNT=OQ^5P+65J2MF zq;sgkivWJ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U6%vUa{h|04Hv33rc39f|#X&pU%tUBW$mBF(t_NR#b zbpBrirgho1@!`)-MNbu`t(@zOqrbJ|I>qx63yZYXL(@6X7Buu SAI2s&151^$CyMNqn*1LU9(4Nv diff --git a/s4t-server-python/node_modules/websocket/build/Release/linker.lock b/s4t-server-python/node_modules/websocket/build/Release/linker.lock deleted file mode 100644 index e69de29..0000000 diff --git a/s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil.node b/s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil.node deleted file mode 100755 index 1b5f4072facd71ffb98197e0a6894be399b1e5e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18514 zcmeHP4|JSWm4A~7Wgwv`*p?zyr)|I%+G!?9)1*|KG@X<{Qeu;oYONoWWSXQ+GGX#f z+CmF0)36=K)CkqXF6&wkF5)h(x&m7j*OXSuzr~Em&Laa=C;_Zs8WhhNcQp3K;M!N~!RQbH!XS zQ(PkHhM#ceJeAKOGDS%G5uXr8u2#7g0_%|{X?hOeanO&0&MYfvdM;4rslZJx1kP+| z^}n%O_gyB0$$LO!HuR5x4s={%`%q7;0^O;f7i}@KK7eW;(2cxeWs~?~^yd3!d}Z3q z1y?q2TK_uZCyR%} zKmFQsH?5iZ$DO~w`#ZnBbL)Mt|Elov_Fw;VdH>y8tAam1?!GqX=RYX<*SDVd-rkpP z+;_5Q?xTel`Y!+7f30Xgc#m!-1+HW#bfS&UqcLDnNT=OQ^5P+65J2MF zq;sgkivWJ@sKEMO2c39`PNEa}Uv}W6&oo3pFY-AV`WQQsjr6q{{ri^;{`(#MV|#Nl z^!u)Z&i22FY!dl@N@vlD^iO8!yD_8wo(%cU0b%{GW$-^~gaeX(BBQrK%B2VnZ_y%SPag)ZU11@Jpq>Dtp zh(Mq1;I9Nu{)d1&>(`@xy?0C=ZP1Q2is>S8o>-bezZ>`v+S>s-<^2ldKR-Zj+V5hy z9tAED;sxNO{|@w`0I7=p4BFpynGjG(%n}!f7~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g{vo6?&aWY&_m|U18Zvy9;i;4U$xFFXhCKo(EQy(wrGv*n3 zf$#x$>Zd5`FZEvnx(F!Th4HHg9)P~NC}Ml-ft&GjVLYS2&G-_(4Y)b;xNy?i1>7Wh z*S-w=Rp2uMYAs?MkBbfIME+?R_=kWy2x^wy{NxA1OJo*m*+v?^F=9 z$fN$V)RLK!zYzG4cg#Po$)I;;;Qbl+L%^N>@k9pw&%lcUvN`nUV)?DE!c_kjswG<% z(H<)@@J|4D#;x6vL4OFibNrskpu4dJIOF6zz{l(}T@(O!#^E&pH)%E=A`YDTeG0fU z?$2>C;%jL^AV8KNol@S0$Z#!ZAcg**A5jKDe}!e$uL?Fce$=XNT3OXtbNxz&&}EaQ zf}AF-F+OOC(Imbe1m)o)|Ev-jS~8)$EWJ6)D6|PhD^<(XZI6lgk&!*>&L}t2JV^$zVmR)s94atx#;Uz-werXV?z6`pOnnpnKVvWDuu% zJw@P$9o-_-3vFwxs|%4-`t?>~GU_vp)v~HrRn`Tq;L7E6X{ot>UQv7fvdUWP`s(V2 zV58MoxvVxwj?Lv|zP7M!^|V-ad#rn-uX!^{5j2{T(b^la)P<<9mVb0*WnE1b28M(8 z*9O&`ahTfJrKpLcNsC5fFj^`??M&j7CJZwiAIOyvUz;@?mSJFlfQ-b^F*i^zO_Ypo zR8hHEd@wVF@@yhKCk}6OMs8~D5GTaRlr{90p^|42UU{nEV&xR$0^HuQcr>-pQcvv~X+{Jnsw#%(9Z0 z-Apgcj!4__Zm8o_$ND^R)V*U6%vUa{h|04Hv33rc39f|#X&pU%tUBW$mBF(t_NR#b zbpBrirgho1@!`)-MNbu`t(@zOqrbJ|I>qx63yZYXL(@6X7Buu SAI2s&151^$CyMNqn*1LU9(4Nv diff --git a/s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil/src/bufferutil.o b/s4t-server-python/node_modules/websocket/build/Release/obj.target/bufferutil/src/bufferutil.o deleted file mode 100644 index c37a49ff84692bd858df18df49ee254e78c0a37a..0000000000000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#91NeX$E6!OPGz3tAo3lAFK zMn0m>J75>LvcDKA;YBd^kS-G97E;8klN3t3NYUQ}DD503g`FHJ?3|>$9cRm+l)pd< z`QMU4{yk7{yAb~fO8GyLLS8nmkjr@VIA<)3Kl{n}Bc)`!jB3Yz5%(#|+lBZNC~==7 z1@6~LA^!_dZ@cmb@*jYw{46Qt)1cmV)jtf%P2|yUq=@jsIOFZz;+z3_acFda{5B!} zob)~+UQ~L-qu!gO7?htY{sU69yN3CBKk|=sJMw{a1LhAY;yOf%N%WMWUna#kJg2Dk ztB!c^3r(dxxFYS1s`@8XeSs8qzoPhWDE>oI*k3?gfZRd~`;**}KCTU(#PHJ!v0$9^#_ijilgrlESYPDg2UgfM2hWhhINc zl;>~c7kV9fhoWmq;cpG>e40GJTK!S_5Bz;sr9SF`L^h}SIMzhN%^k1@*r^*sC5DF<~DiweVX)oAzmg$r)O0?f9Fa$ s&n&$+qaEpIa0W`c6yHfnF)806#o`oToNvRqI_Wa3o1~wEJ}IvM1Ed0EJOBUy diff --git a/s4t-server-python/node_modules/websocket/build/Release/obj.target/validation.node b/s4t-server-python/node_modules/websocket/build/Release/obj.target/validation.node deleted file mode 100755 index e762158dde3d1d05c624026e6955fb4299e95eda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18448 zcmeHPe{@_`oxhVz+kyU=QVLYSWhepK(oQo?+9sv8Nz+LQv?Vr43u1jvl1Vd=Wa7-5 zH1+VKIQ_vm1|y>Dk+afWJgci`kKILkP}$>PD->B3Q52Qc$`45-LJNppmgDT_bAL?U zyd-Vo(LZ)iZ_b_X``+*Oe((2w@Auw!-+k|!yTTjmJsyuRsZ^8-V#m)Hq7twsq$rgl zAf|~0;!^P*NjLn2Z(XJG6e6>Qq#p|kacqss8zHa}d8($D0FHn@0y?v-py^(q%yWU8 zTn3!k&>CO1+sjd4vJD!up}!w=pkor-hk9ZQ=uZ6tXp5Qk0aW{drN|pLw}`LKtiSc( zr+-*^|A9sK{b1*R+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j_!U+y*Hp7{-nL#q#Z&Gk}eYBW29&=Tqvl|cMRGa2W34+NMYv$ zDe5^vIqYSBQT~RKe_hGHq2%9D@^_T{2TK0FlFRmN$D0N7;lFLnhyVJ?12;{IdS4_( zy`Q5T^&VI9FDd!&EBPNOxwHr6zoq2ol>CB{%l2)?|Kc+LBlzid^@mvx{5nM1dHeM^ z%b~b%VXX36ObQoBD#t5$j#K9Ienh$)l>NAYv`dJcr0DFuq&-%Dx_gBfQ#}3X-Yvuz zNp}hPe(%QM{%i6Wd~cIt9Q+gMvqJnQDe&*&yh6YDLEU>WZb{+PT2fTjLAnp~ofPGh zq$vNJq|f6W1C;&y$E3h{gA|QBMLGKSjFMke@^_T{`${hT@EdC0KCS%Fs{DXKB;{zl z^wXzj$^&f2Lfn-};kR+pJ7Etg`mI2U>*f_wboxrxyA=0TQaG9K>TWpwcS-S~q(BNB LJ}J5H6XJgWo;&96 diff --git a/s4t-server-python/node_modules/websocket/build/Release/validation.node b/s4t-server-python/node_modules/websocket/build/Release/validation.node deleted file mode 100755 index e762158dde3d1d05c624026e6955fb4299e95eda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18448 zcmeHPe{@_`oxhVz+kyU=QVLYSWhepK(oQo?+9sv8Nz+LQv?Vr43u1jvl1Vd=Wa7-5 zH1+VKIQ_vm1|y>Dk+afWJgci`kKILkP}$>PD->B3Q52Qc$`45-LJNppmgDT_bAL?U zyd-Vo(LZ)iZ_b_X``+*Oe((2w@Auw!-+k|!yTTjmJsyuRsZ^8-V#m)Hq7twsq$rgl zAf|~0;!^P*NjLn2Z(XJG6e6>Qq#p|kacqss8zHa}d8($D0FHn@0y?v-py^(q%yWU8 zTn3!k&>CO1+sjd4vJD!up}!w=pkor-hk9ZQ=uZ6tXp5Qk0aW{drN|pLw}`LKtiSc( zr+-*^|A9sK{b1*R+Tq1(?m7>&1)6snV2$VUsRyTCJpJR-Ja^x-v~dw>3y~KiFF{_4 zT#n47O)BlX9QX?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j7o$+#C z0Pc*>djYsf^KtQK;LdorC60R{$Lo6F-1{*x{?GANkMH=b4~!GzQOUP;V`3ysd>8_4 zLe-YlxFy`&e6v;GvbnCg;l|Ajr5jI{ijkSH#@Lt_Mur4?5uAr_{Ku8ZFp&x6jnkV+ zMx#wev*EOqPoZNQL(AhG9m%MjtWU(db)nW?hpep7 z;U0{>7&lmD!e)!*sPL%CN@+{jNgMCHgK!e-`noOF#)hV5jPhuFq-A$oZH$mi;?1%O znRFCcR(ssqA%hOBb~~O(T9H)0z++%+74s%~o^mx{YCS^jED2 z?ugn}Z<}Rzrh0A*w)UeG!Jh>g?a8>M-nt8G{mq+eH#O8@1Z7anUl`>wsTjP`FrkV` zMi-5ZI~+e2ZxXRR<3?Id7`rw$RLd28J8rNn1HEc$WO$Aa#L@A&5 zc{fxayi6QA@35`;R;mzLIjQhkrw^FOR~Wshqo)rzXAGmh?TlGWP8IL%yhoWBTjd>R z9J)K!j4EiEW~3!1@!tj1|69-@n&bRWgE37_a{q>VxAXrojIQhq^K{L}GmB`SC{kVa G true when in the browser - -var ws = new WS('ws://example.com/resource', 'foo', 'http://example.com'); -// - In Node it creates an instance of websocket.W3CWebSocket. -// - In the browser it creates an instance of window.WebSocket (third parameter -// is ignored by the native WebSocket constructor). - -ws.onopen = function() { console.log('ws open'); }; -// etc. -``` - - -Constructor ------------ - -```javascript -new W3CWebSocket(requestUrl, requestedProtocols, [[[[origin], headers], requestOptions], clientConfig]) -``` - -**clientConfig** is the parameter of the [WebSocketClient](./WebSocketClient.md) constructor. - -**requestUrl**, **requestedProtocols**, **origin**, **headers** and **requestOptions** are parameters to be used in the `connect()` method of [WebSocketClient](./WebSocketClient.md). - -This constructor API makes it possible to use the W3C API and "browserify" the Node application into a valid browser library. - -When running in a browser (for example by using [browserify](http://browserify.org/)) the browser's native `WebSocket` implementation is used, and thus just the first and second arguments (`requestUrl` and `requestedProtocols`) are used (those allowed by the *W3C WebSocket API*). - - -Limitations ------------ - -* `bufferedAmount` attribute is always 0. -* `binaryType` is "arraybuffer" by default given that "blob" is not supported (Node does not implement the `Blob` class). -* `send()` method allows arguments of type `DOMString`, `ArrayBuffer`, `ArrayBufferView` (`Int8Array`, etc) or Node `Buffer`, but does not allow `Blob`. diff --git a/s4t-server-python/node_modules/websocket/docs/WebSocketClient.md b/s4t-server-python/node_modules/websocket/docs/WebSocketClient.md deleted file mode 100644 index 8120545..0000000 --- a/s4t-server-python/node_modules/websocket/docs/WebSocketClient.md +++ /dev/null @@ -1,108 +0,0 @@ -WebSocketClient -=============== - -* [Constructor](#constructor) -* [Config Options](#client-config-options) -* [Methods](#methods) -* [Events](#events) -* **Examples** - * [Connect using a Proxy Server](#connect-using-a-proxy-server) - -`var WebSocketClient = require('websocket').client` - -This object allows you to make client connections to a WebSocket server. - -Constructor ------------ -```javascript -new WebSocketClient([clientConfig]); -``` - -Client Config Options ---------------------- -**webSocketVersion** - uint - *Default: 13* -Which version of the WebSocket protocol to use when making the connection. Currently supported values are 8 and 13. -This option will be removed once the protocol is finalized by the IETF It is only available to ease the transition through the intermediate draft protocol versions. The only thing this affects the name of the Origin header. - -**maxReceivedFrameSize** - uint - *Default: 1MiB* -The maximum allowed received frame size in bytes. Single frame messages will also be limited to this maximum. - -**maxReceivedMessageSize** - uint - *Default: 8MiB* -The maximum allowed aggregate message size (for fragmented messages) in bytes. - -**fragmentOutgoingMessages** - Boolean - *Default: true* -Whether or not to fragment outgoing messages. If true, messages will be automatically fragmented into chunks of up to `fragmentationThreshold` bytes. - -**fragmentationThreshold** - uint - *Default: 16KiB* -The maximum size of a frame in bytes before it is automatically fragmented. - -**assembleFragments** - boolean - *Default: true* -If true, fragmented messages will be automatically assembled and the full message will be emitted via a `message` event. If false, each frame will be emitted on the WebSocketConnection object via a `frame` event and the application will be responsible for aggregating multiple fragmented frames. Single-frame messages will emit a `message` event in addition to the `frame` event. Most users will want to leave this set to `true`. - -**closeTimeout** - uint - *Default: 5000* -The number of milliseconds to wait after sending a close frame for an acknowledgement to come back before giving up and just closing the socket. - -**tlsOptions** - object - *Default: {}* -Options to pass to `https.request` if connecting via TLS. See [Node's HTTPS documentation](http://nodejs.org/api/https.html#https_https_request_options_callback) - - -Methods -------- -###connect(requestUrl, requestedProtocols, [[[origin], headers], requestOptions]) - -Will establish a connection to the given `requestUrl`. `requestedProtocols` indicates a list of multiple subprotocols supported by the client. The remote server will select the best subprotocol that it supports and send that back when establishing the connection. `origin` is an optional field that can be used in user-agent scenarios to identify the page containing any scripting content that caused the connection to be requested. (This seems unlikely in node.. probably should leave it null most of the time.) `requestUrl` should be a standard websocket url, such as: -`ws://www.mygreatapp.com:1234/websocketapp/` - -`headers` should be either `null` or an object specifying additional arbitrary HTTP request headers to send along with the request. This may be used to pass things like access tokens, etc. so that the server can verify authentication/authorization before deciding to accept and open the full WebSocket connection. - -`requestOptions` should be either `null` or an object specifying additional configuration options to be passed to `http.request` or `https.request`. This can be used to pass a custom `agent` to enable `WebSocketClient` usage from behind an HTTP or HTTPS proxy server using [koichik/node-tunnel](https://github.com/koichik/node-tunnel) or similar. - -`origin` must be specified if you want to pass `headers`, and both `origin` and `headers` must be specified if you want to pass `requestOptions`. The `origin` and `headers` parameters may be passed as `null`. - - -Events ------- -###connect -`function(webSocketConnection)` - -Emitted upon successfully negotiating the WebSocket handshake with the remote server. `webSocketConnection` is an instance of `WebSocketConnection` that can be used to send and receive messages with the remote server. - -###connectFailed -`function(errorDescription)` - -Emitted when there is an error connecting to the remote host or the handshake response sent by the server is invalid. - -###httpResponse -`function(response, webSocketClient)` - -Emitted when the server replies with anything other then "101 Switching Protocols". Provides an opportunity to handle redirects for example. The `response` parameter is an instance of the [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage) class. This is not suitable for handling receiving of large response bodies, as the underlying socket will be immediately closed by WebSocket-Node as soon as all handlers for this event are executed. - -Normally, if the remote server sends an HTTP response with a response code other than 101, the `WebSocketClient` will automatically emit the `connectFailed` event with a description of what was received from the remote server. However, if there are one or more listeners attached to the `httpResponse` event, then the `connectFailed` event will not be emitted for non-101 responses received. `connectFailed` will still be emitted for non-HTTP errors, such as when the remote server is unreachable or not accepting TCP connections. - - -Examples -======== - -Connect using a Proxy Server ----------------------------- - -Using [koichik/node-tunnel](https://github.com/koichik/node-tunnel): - -```javascript -var WebSocketClient = require('websocket').client; -var client = new WebSocketClient(); -var tunnel = require('tunnel'); - -var tunnelingAgent = tunnel.httpOverHttp({ - proxy: { - host: 'proxy.host.com', - port: 8080 - } -}); - -var requestOptions = { - agent: tunnelingAgent -}; - -client.connect('ws://echo.websocket.org/', null, null, null, requestOptions); -``` diff --git a/s4t-server-python/node_modules/websocket/docs/WebSocketConnection.md b/s4t-server-python/node_modules/websocket/docs/WebSocketConnection.md deleted file mode 100644 index ceaccb6..0000000 --- a/s4t-server-python/node_modules/websocket/docs/WebSocketConnection.md +++ /dev/null @@ -1,131 +0,0 @@ -WebSocketConnection -=================== - -* [Constructor](#constructor) -* [Properties](#properties) -* [Methods](#methods) -* [Events](#events) - -This object provides the interface through which you can communicate with connected peers. It is used in both WebSocketServer and WebSocketClient situations. - -Constructor ------------ -This object is created internally by `WebSocketRequest`. - -Properties ----------- - -###closeDescription - -After the connection is closed, contains a textual description of the reason for the connection closure, or `null` if the connection is still open. - -###closeReasonCode - -After the connection is closed, contains the numeric close reason status code, or `-1` if the connection is still open. - -###socket - -The underlying net.Socket instance for the connection. - -###protocol - -The subprotocol that was chosen to be spoken on this connection. This field will have been converted to lower case. - -###extensions - -An array of extensions that were negotiated for this connection. Currently unused, will always be an empty array. - -###remoteAddress - -The IP address of the remote peer as a string. In the case of a server, the `X-Forwarded-For` header will be respected and preferred for the purposes of populating this field. If you need to get to the actual remote IP address, `webSocketConnection.socket.remoteAddress` will provide it. - -###webSocketVersion - -A number indicating the version of the WebSocket protocol being spoken on this connection. - -###connected - -A boolean value indicating whether or not the connection is still connected. *Read-only* - -Methods -------- -###close([reasonCode], [description]) - -Will gracefully close the connection. A close frame will be sent to the remote peer with the provided `reasonCode` and `description` indicating that we wish to close the connection, and we will then wait for up to `config.closeTimeout` milliseconds for an acknowledgment from the remote peer before terminating the underlying socket connection. The `closeTimeout` is passed as part of the `serverOptions` or `clientOptions` hashes to either the `WebSocketServer` or `WebSocketClient` constructors. Most of the time, you should call `close()` without arguments to initiate a normal connection closure. If you specify a `reasonCode` that is defined as one of the standard codes in the WebSocket protocol specification and do not provide a `description`, the default description for the given code will be used. If you would prefer not to send a description at all, pass an empty string `''`as the description parameter. - -###drop([reasonCode], [description]) - -Will send a close frame to the remote peer with the provided `reasonCode` and `description` and will immediately close the socket without waiting for a response. This should generally be used only in error conditions. The default `reasonCode` is 1002 (Protocol Error). Close reasons defined by the WebSocket protocol draft include: - -```javascript -WebSocketConnection.CLOSE_REASON_NORMAL = 1000; -WebSocketConnection.CLOSE_REASON_GOING_AWAY = 1001; -WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR = 1002; -WebSocketConnection.CLOSE_REASON_UNPROCESSABLE_INPUT = 1003; -WebSocketConnection.CLOSE_REASON_RESERVED = 1004; // Reserved value. Undefined meaning. -WebSocketConnection.CLOSE_REASON_NOT_PROVIDED = 1005; // Not to be used on the wire -WebSocketConnection.CLOSE_REASON_ABNORMAL = 1006; // Not to be used on the wire -WebSocketConnection.CLOSE_REASON_INVALID_DATA = 1007; -WebSocketConnection.CLOSE_REASON_POLICY_VIOLATION = 1008; -WebSocketConnection.CLOSE_REASON_MESSAGE_TOO_BIG = 1009; -WebSocketConnection.CLOSE_REASON_EXTENSION_REQUIRED = 1010; -``` -###sendUTF(string) - -Immediately sends the specified string as a UTF-8 WebSocket message to the remote peer. If `config.fragmentOutgoingMessages` is `true` the message may be sent as multiple fragments if it exceeds `config.fragmentationThreshold` bytes. Any object that implements the `toString()` method may be passed to `sendUTF()` - -###sendBytes(buffer) - -Immediately sends the specified Node `Buffer` object as a Binary WebSocket message to the remote peer. If `config.fragmentOutgoingMessages` is `true` the message may be sent as multiple fragments if it exceeds `config.fragmentationThreshold` bytes. - -###send(data) - -A convenience function that will auto-detect the data type and send the appropriate WebSocket message accordingly. Immediately sends the specified data as either a UTF-8 or Binary message. If `data` is a Node Buffer, a binary message will be sent. Otherwise, the object provided must implement the `toString()` method, and the result of calling `toString()` on the `data` object will be sent as a UTF-8 message. - -###ping(data) - -Sends a ping frame to the remote peer. `data` can be a Node `Buffer` or any object that implements `toString()`, such as a `string` or `number`. Ping frames must not exceed 125 bytes in length. - -###pong(buffer) - -Sends a pong frame to the remote peer. Pong frames may be sent unsolicited and such pong frames will trigger no action on the receiving peer. Pong frames sent in response to a ping frame must mirror the payload data of the ping frame exactly. The `WebSocketConnection` object handles this internally for you, so there should be no need to use this method to respond to pings. Pong frames must not exceed 125 bytes in length. - -###sendFrame(webSocketFrame) - -Serializes a `WebSocketFrame` object into binary data and immediately sends it to the remote peer. This is an advanced function, requiring you to manually compose your own `WebSocketFrame`. You should probably use `sendUTF` or `sendBytes` instead. - -Events ------- -###message -`function(message)` - -Emitted whenever a complete single-frame message is received, or if `config.assembleFragments` is `true` (the default), it will also be emitted with a complete message assembled from multiple fragmented frames. This is the primary event to listen for to receive messages from the remote peer. The `message` object looks like the following: - -```javascript -// For Text Frames: -{ - type: "utf8", - utf8Data: "A string containing the received message." -} - -// For Binary Frames: -{ - type: "binary", - binaryData: binaryDataBuffer // a Buffer object containing the binary message payload -} -``` - -###frame -`function(webSocketFrame)` - -This event is emitted only if `config.assembleFragments` is `false` (default is `true`). This allows you to handle individual fragments as they are received without waiting on `WebSocketConnection` to buffer them into a single `message` event for you. This may be desirable if you are working with streaming data, as it is possible to send fragments continually without ever stopping. `webSocketFrame` is an instance of `WebSocketFrame` which has properties that represent all the individual fields in WebSocket's binary framing protocol. - -###close -`function(reasonCode, description)` - -This event is emitted when the connection has been fully closed and the socket is no longer connected. `reasonCode` is the numeric reason code for the connection closure. `description` is a textual explanation for the connection closure, if available. - -###error -`function(error)` - -This event is emitted when there has been a socket error. If this occurs, a `close` event will also be emitted. diff --git a/s4t-server-python/node_modules/websocket/docs/WebSocketFrame.md b/s4t-server-python/node_modules/websocket/docs/WebSocketFrame.md deleted file mode 100644 index e3160d3..0000000 --- a/s4t-server-python/node_modules/websocket/docs/WebSocketFrame.md +++ /dev/null @@ -1,66 +0,0 @@ -WebSocketFrame -============== - -* [Constructor](#constructor) -* [Properties](#properties) - -`var WebSocketFrame = require('websocket').frame` - -This object represents the low level individual frame and is used to drive how the bytes are serialized onto the wire. - -Constructor ------------ -```javascript -new WebSocketFrame(); -``` - -Properties ----------- - -###fin -*Boolean* - -Indicates that this is either the only frame in a message, or the last frame in a fragmentation sequence. - -###rsv1 -*Boolean* - -Represents the RSV1 field in the framing, which is currently not used. Setting this to true will result in a Protocol Error on the receiving peer. - -###rsv2 -*Boolean* - -Represents the RSV2 field in the framing, which is currently not used. Setting this to true will result in a Protocol Error on the receiving peer. - -###rsv3 -*Boolean* - -Represents the RSV3 field in the framing, which is currently not used. Setting this to true will result in a Protocol Error on the receiving peer. - -###mask -*uint* - -Whether or not this frame is (or should be) masked. For outgoing frames, when connected as a client, this flag is automatically forced to `true` by WebSocketConnection. Outgoing frames sent from the server-side of a connection are not masked. - -###opcode -*uint* - -Identifies which kind of frame this is. List of Opcodes: - - Hex - Dec - Description - 0x00 - 0 - Continuation - 0x01 - 1 - Text Frame - 0x02 - 2 - Binary Frame - 0x08 - 8 - Close Frame - 0x09 - 9 - Ping Frame - 0x0A - 10 - Pong Frame - -###length -*Read-only, uint* - -Identifies the length of the payload data on a received frame. When sending a frame, the length will be automatically calculated from the `binaryPayload` object. - -###binaryPayload -*Buffer object* - -The binary payload data. **NOTE**: Even text frames are sent with a Buffer providing the binary payload data. When sending a UTF-8 Text Frame, you must serialize your string into a Buffer object before constructing your frame, and when receiving a UTF-8 Text Frame, you must deserialize the string from the provided Buffer object. Do not read UTF-8 data from fragmented Text Frames, as it may have fragmented the data in the middle of a UTF-8 encoded character. You should buffer all fragments of a text message before attempting to decode the UTF-8 data. diff --git a/s4t-server-python/node_modules/websocket/docs/WebSocketRequest.md b/s4t-server-python/node_modules/websocket/docs/WebSocketRequest.md deleted file mode 100644 index 11e6d60..0000000 --- a/s4t-server-python/node_modules/websocket/docs/WebSocketRequest.md +++ /dev/null @@ -1,113 +0,0 @@ -WebSocketRequest -================ - -* [Constructor](#constructor) -* [Properties](#properties) -* [Methods](#methods) -* [Events](#events) - -This object represents a client requesting to connect to the server, and allows you to accept or reject the connection based on whatever criteria you decide. - -Constructor ------------ -This object is created internally by `WebSocketServer`. - -However if you need to integrate WebSocket support without mounting an instance of `WebSocketServer` to your http server directly, you can handle the `upgrade` event yourself and pass the appropriate parameters to the `WebSocketRequest` constructor. **NOTE:** You *must* pass a complete set of config options to the constructor. See the section *'Server Config Options'* above. The only option that isn't required in this context is `httpServer`. - -```javascript -new WebSocketRequest(socket, httpRequest, config); -``` - -The constructor won't immediately parse and validate the handshake from the client, so you need to call `readHandshake()`, which will `throw` an error if the handshake from the client is invalid or if an error is encountered, so it must always be wrapped in a try/catch block. - -Properties ----------- -###httpRequest - -A reference to the original Node HTTP request object. This may be useful in combination with some other Node-based web server, such as Express, for accessing cookies or session data. - - -###host - -A string containing the contents of the `Host` header passed by the client. This will include the port number if a non-standard port is used. - -Examples: -``` -www.example.com -www.example.com:8080 -127.0.0.1:3000 -``` - -###resource - -A string containing the path that was requested by the client. - -###resourceURL - -A Node URL object containing the parsed `resource`, including the query string parameters. - -###remoteAddress - -The remote client's IP Address as a string. If an `X-Forwarded-For` header is present, the value will be taken from that header to facilitate WebSocket servers that live behind a reverse-proxy. - -###websocketVersion - -**Deprecated, renamed to webSocketVersion** - -###webSocketVersion - -A number indicating the version of the WebSocket protocol requested by the client. - -###origin - -If the client is a web browser, `origin` will be a string containing the URL of the page containing the script that opened the connection. If the client is **not** a web browser, `origin` may be `null` or "*". - -###requestedExtensions - -An array containing a list of extensions requested by the client. This is not currently used for anything. **Example:** - -```javascript -[ - { - name: "simple-extension"; - }, - { - name: "my-great-compression-extension", - params: [ - { - name: "compressionLevel", - value: "10"; - } - ] - } -] -``` - -###requestedProtocols - -An array containing a list of strings that indicate the subprotocols the client would like to speak. The server should select the best one that it can support from the list and pass it to the accept() function when accepting the connection. Note that all the strings in the `requestedProtocols` array will have been converted to lower case, so that acceptance of a subprotocol can be case-insensitive. - -Methods -------- - -###accept(acceptedProtocol, allowedOrigin) -*Returns: WebSocketConnection instance* - -After inspecting the WebSocketRequest's properties, call this function on the request object to accept the connection. If you don't have a particular subprotocol you wish to speak, you may pass `null` for the `acceptedProtocol` parameter. Note that the `acceptedProtocol` parameter is *case-insensitive*, and you must either pass a value that was originally requested by the client or `null`. For browser clients (in which the `origin` property would be non-null) you must pass that user's origin as the `allowedOrigin` parameter to confirm that you wish to accept connections from the given origin. The return value contains the established `WebSocketConnection` instance that can be used to communicate with the connected client. - -###reject([httpStatus], [reason]) - -If you decide to reject the connection, you must call `reject`. You may optionally pass in an HTTP Status code (such as 404) and a textual description that will be sent to the client in the form of an "X-WebSocket-Reject-Reason" header. The connection will then be closed. - -Events ------- - -###requestAccepted -`function(webSocketConnection)` - -Emitted by the WebSocketRequest object when the `accept` method has been called and the connection has been established. `webSocketConnection` is the established `WebSocketConnection` instance that can be used to communicate with the connected client. - -###requestRejected -`function()` - -Emitted by the WebSocketRequest object when the `reject` method has been called and the connection has been terminated. diff --git a/s4t-server-python/node_modules/websocket/docs/WebSocketServer.md b/s4t-server-python/node_modules/websocket/docs/WebSocketServer.md deleted file mode 100644 index 20154eb..0000000 --- a/s4t-server-python/node_modules/websocket/docs/WebSocketServer.md +++ /dev/null @@ -1,105 +0,0 @@ -WebSocketServer -=============== - -* [Constructor](#constructor) -* [Config Options](#server-config-options) -* [Properties](#properties) -* [Methods](#methods) -* [Events](#events) - -`var WebSocketServer = require('websocket').server` - -Constructor ------------ - -```javascript -new WebSocketServer([serverConfig]); -``` - -Methods -------- - -###mount(serverConfig) - -`mount` will attach the WebSocketServer instance to a Node http.Server instance. `serverConfig` is required, and is an object with configuration values. For those values, see **Server Config Options** below. If you passed `serverConfig` to the constructor, this function will automatically be invoked. - -###unmount() - -`unmount` will detach the WebSocketServer instance from the Node http.Server instance. All existing connections are left alone and will not be affected, but no new WebSocket connections will be accepted. - -###closeAllConnections() - -Will gracefully close all open WebSocket connections. - -###shutDown() - -Gracefully closes all open WebSocket connections and unmounts the server from the Node http.Server instance. - -Server Config Options ---------------------- -**httpServer** - (http.Server instance) **Required**. -The Node http or https server instance(s) to attach to. You can pass a single instance directly, or pass an array of instances to attach to multiple http/https servers. Passing an array is particularly useful when you want to accept encrypted and unencrypted WebSocket connections on both ws:// and wss:// protocols using the same WebSocketServer instance. - -**maxReceivedFrameSize** - uint - *Default: 64KiB* -The maximum allowed received frame size in bytes. Single frame messages will also be limited to this maximum. - -**maxReceivedMessageSize** - uint - *Default: 1MiB* -The maximum allowed aggregate message size (for fragmented messages) in bytes. - -**fragmentOutgoingMessages** - Boolean - *Default: true* -Whether or not to fragment outgoing messages. If true, messages will be automatically fragmented into chunks of up to `fragmentationThreshold` bytes. - -**fragmentationThreshold** - uint - *Default: 16KiB* -The maximum size of a frame in bytes before it is automatically fragmented. - -**keepalive** - boolean - *Default: true* -If true, the server will automatically send a ping to all clients every `keepaliveInterval` milliseconds. Each client has an independent keepalive timer, which is reset when any data is received from that client. - -**keepaliveInterval** - uint - *Default: 20000* -The interval in milliseconds to send keepalive pings to connected clients. - -**dropConnectionOnKeepaliveTimeout** - boolean - *Default: true* -If true, the server will consider any connection that has not received any data within the amount of time specified by `keepaliveGracePeriod` after a keepalive ping has been sent. Ignored if `keepalive` is false. - -**keepaliveGracePeriod** - uint - *Default: 10000* -The amount of time to wait after sending a keepalive ping before closing the connection if the connected peer does not respond. Ignored if `keepalive` or `dropConnectionOnKeepaliveTimeout` are false. The grace period timer is reset when any data is received from the client. - -**assembleFragments** - boolean - *Default: true* -If true, fragmented messages will be automatically assembled and the full message will be emitted via a `message` event. If false, each frame will be emitted on the WebSocketConnection object via a `frame` event and the application will be responsible for aggregating multiple fragmented frames. Single-frame messages will emit a `message` event in addition to the `frame` event. Most users will want to leave this set to `true`. - -**autoAcceptConnections** - boolean - *Default: false* -If this is true, websocket connections will be accepted regardless of the path and protocol specified by the client. The protocol accepted will be the first that was requested by the client. Clients from any origin will be accepted. This should only be used in the simplest of cases. You should probably leave this set to `false`; and inspect the request object to make sure it's acceptable before accepting it. - -**closeTimeout** - uint - *Default: 5000* -The number of milliseconds to wait after sending a close frame for an acknowledgement to come back before giving up and just closing the socket. - -**disableNagleAlgorithm** - boolean - *Default: true* -The Nagle Algorithm makes more efficient use of network resources by introducing a small delay before sending small packets so that multiple messages can be batched together before going onto the wire. This however comes at the cost of latency, so the default is to disable it. If you don't need low latency and are streaming lots of small messages, you can change this to 'false'; - -**ignoreXForwardedFor** - Boolean - *Default: false* -Whether or not the `X-Forwarded-For` header should be respected. -It's important to set this to 'true' when accepting connections -from untrusted clients, as a malicious client could spoof its -IP address by simply setting this header. It's meant to be added -by a trusted proxy or other intermediary within your own -infrastructure. -More info: [X-Forwarded-For on Wikipedia](http://en.wikipedia.org/wiki/X-Forwarded-For) - -Events ------- -There are three events emitted by a WebSocketServer instance that allow you to handle incoming requests, establish connections, and detect when a connection has been closed. - -###request -`function(webSocketRequest)` - -If `autoAcceptConnections` is set to `false`, a `request` event will be emitted by the server whenever a new WebSocket request is made. You should inspect the requested protocols and the user's origin to verify the connection, and then accept or reject it by calling webSocketRequest.accept('chosen-protocol', 'accepted-origin') or webSocketRequest.reject() - -###connect -`function(webSocketConnection)` - -Emitted whenever a new WebSocket connection is accepted. - -###close -`function(webSocketConnection, closeReason, description)` - -Whenever a connection is closed for any reason, the WebSocketServer instance will emit a `close` event, passing a reference to the WebSocketConnection instance that was closed. `closeReason` is the numeric reason status code for the connection closure, and `description` is a textual description of the close reason, if available. diff --git a/s4t-server-python/node_modules/websocket/docs/index.md b/s4t-server-python/node_modules/websocket/docs/index.md deleted file mode 100644 index d42a250..0000000 --- a/s4t-server-python/node_modules/websocket/docs/index.md +++ /dev/null @@ -1,13 +0,0 @@ -WebSocket-Node Documentation -============================ - -WebSocket-Node includes both client and server functionality, available through WebSocketClient and WebSocketServer respectively. Once a connection is established, the API for sending and receiving messages is identical whether you're acting as a client or server. - -Click on one of the classes below to view its API documentation. - -* [WebSocketClient](./WebSocketClient.md) -* [WebSocketConnection](./WebSocketConnection.md) -* [WebSocketFrame](./WebSocketFrame.md) -* [WebSocketRequest](./WebSocketRequest.md) -* [WebSocketServer](./WebSocketServer.md) -* [W3CWebSocket](./W3CWebSocket.md) diff --git a/s4t-server-python/node_modules/websocket/gulpfile.js b/s4t-server-python/node_modules/websocket/gulpfile.js deleted file mode 100644 index b515b92..0000000 --- a/s4t-server-python/node_modules/websocket/gulpfile.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Dependencies. - */ -var gulp = require('gulp'); -var jshint = require('gulp-jshint'); - -gulp.task('lint', function() { - return gulp.src(['gulpfile.js', 'lib/**/*.js', 'test/**/*.js']) - .pipe(jshint('.jshintrc')) - .pipe(jshint.reporter('jshint-stylish', {verbose: true})) - .pipe(jshint.reporter('fail')); -}); - -gulp.task('default', gulp.series('lint')); diff --git a/s4t-server-python/node_modules/websocket/index.js b/s4t-server-python/node_modules/websocket/index.js deleted file mode 100644 index 573969f..0000000 --- a/s4t-server-python/node_modules/websocket/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/websocket'); \ No newline at end of file diff --git a/s4t-server-python/node_modules/websocket/lib/BufferUtil.fallback.js b/s4t-server-python/node_modules/websocket/lib/BufferUtil.fallback.js deleted file mode 100644 index de18bfb..0000000 --- a/s4t-server-python/node_modules/websocket/lib/BufferUtil.fallback.js +++ /dev/null @@ -1,52 +0,0 @@ -/*! - * Copied from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -/* jshint -W086 */ - -module.exports.BufferUtil = { - merge: function(mergedBuffer, buffers) { - var offset = 0; - for (var i = 0, l = buffers.length; i < l; ++i) { - var buf = buffers[i]; - buf.copy(mergedBuffer, offset); - offset += buf.length; - } - }, - mask: function(source, mask, output, offset, length) { - var maskNum = mask.readUInt32LE(0, true); - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ source.readUInt32LE(i, true); - if (num < 0) { num = 4294967296 + num; } - output.writeUInt32LE(num, offset + i, true); - } - switch (length % 4) { - case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; - case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; - case 1: output[offset + i] = source[i] ^ mask[0]; - case 0: - } - }, - unmask: function(data, mask) { - var maskNum = mask.readUInt32LE(0, true); - var length = data.length; - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ data.readUInt32LE(i, true); - if (num < 0) { num = 4294967296 + num; } - data.writeUInt32LE(num, i, true); - } - switch (length % 4) { - case 3: data[i + 2] = data[i + 2] ^ mask[2]; - case 2: data[i + 1] = data[i + 1] ^ mask[1]; - case 1: data[i] = data[i] ^ mask[0]; - case 0: - } - } -}; - -/* jshint +W086 */ \ No newline at end of file diff --git a/s4t-server-python/node_modules/websocket/lib/BufferUtil.js b/s4t-server-python/node_modules/websocket/lib/BufferUtil.js deleted file mode 100644 index fa37c80..0000000 --- a/s4t-server-python/node_modules/websocket/lib/BufferUtil.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * Copied from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -try { - module.exports = require('../build/Release/bufferutil'); -} catch (e) { try { - module.exports = require('../build/default/bufferutil'); -} catch (e) { try { - module.exports = require('./BufferUtil.fallback'); -} catch (e) { - console.error('bufferutil.node seems to not have been built. Run npm install.'); - throw e; -}}} diff --git a/s4t-server-python/node_modules/websocket/lib/Deprecation.js b/s4t-server-python/node_modules/websocket/lib/Deprecation.js deleted file mode 100644 index f93f16f..0000000 --- a/s4t-server-python/node_modules/websocket/lib/Deprecation.js +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var Deprecation = { - disableWarnings: false, - - deprecationWarningMap: { - - }, - - warn: function(deprecationName) { - if (!this.disableWarnings && this.deprecationWarningMap[deprecationName]) { - console.warn('DEPRECATION WARNING: ' + this.deprecationWarningMap[deprecationName]); - this.deprecationWarningMap[deprecationName] = false; - } - } -}; - -module.exports = Deprecation; diff --git a/s4t-server-python/node_modules/websocket/lib/Validation.fallback.js b/s4t-server-python/node_modules/websocket/lib/Validation.fallback.js deleted file mode 100644 index 6160f88..0000000 --- a/s4t-server-python/node_modules/websocket/lib/Validation.fallback.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * UTF-8 Validation Fallback Code originally from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -module.exports.Validation = { - isValidUTF8: function() { - return true; - } -}; diff --git a/s4t-server-python/node_modules/websocket/lib/Validation.js b/s4t-server-python/node_modules/websocket/lib/Validation.js deleted file mode 100644 index b4106e8..0000000 --- a/s4t-server-python/node_modules/websocket/lib/Validation.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * UTF-8 Validation Code originally from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -try { - module.exports = require('../build/Release/validation'); -} catch (e) { try { - module.exports = require('../build/default/validation'); -} catch (e) { try { - module.exports = require('./Validation.fallback'); -} catch (e) { - console.error('validation.node seems not to have been built. Run npm install.'); - throw e; -}}} diff --git a/s4t-server-python/node_modules/websocket/lib/W3CWebSocket.js b/s4t-server-python/node_modules/websocket/lib/W3CWebSocket.js deleted file mode 100644 index 5234352..0000000 --- a/s4t-server-python/node_modules/websocket/lib/W3CWebSocket.js +++ /dev/null @@ -1,264 +0,0 @@ -/************************************************************************ - * Copyright 2010-2014 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var WebSocketClient = require('./WebSocketClient'); -var toBuffer = require('typedarray-to-buffer'); - - -const CONNECTING = 0; -const OPEN = 1; -const CLOSING = 2; -const CLOSED = 3; - - -function WebSocket(url, protocols, origin, headers, requestOptions, clientConfig) { - // Sanitize clientConfig. - clientConfig = clientConfig || {}; - clientConfig.assembleFragments = true; // Required in the W3C API. - - // W3C attributes and listeners. - this._listeners = { - onopen: undefined, - onerror: undefined, - onclose: undefined, - onmessage: undefined - }; - this._url = url; - this._readyState = CONNECTING; - this._protocol = undefined; - this._extensions = ''; - this._bufferedAmount = 0; // Hack, always 0. - this._binaryType = 'arraybuffer'; // TODO: Should be 'blob' by default, but Node has no Blob. - - // The WebSocketConnection instance. - this._connection = undefined; - - // WebSocketClient instance. - this._client = new WebSocketClient(clientConfig); - - this._client.on('connect', onConnect.bind(this)); - this._client.on('connectFailed', onConnectFailed.bind(this)); - - this._client.connect(url, protocols, origin, headers, requestOptions); -} - - -// Expose W3C listener setters/getters. -['onopen', 'onerror', 'onclose', 'onmessage'].forEach(function(method) { - Object.defineProperty(WebSocket.prototype, method, { - get: function() { - return this._listeners[method]; - }, - set: function(listener) { - if (typeof listener === 'function') { - this._listeners[method] = listener; - } - else { - this._listeners[method] = undefined; - } - } - }); -}); - - -// Expose W3C read only attributes. -Object.defineProperties(WebSocket.prototype, { - url: { get: function() { return this._url; } }, - readyState: { get: function() { return this._readyState; } }, - protocol: { get: function() { return this._protocol; } }, - extensions: { get: function() { return this._extensions; } }, - bufferedAmount: { get: function() { return this._bufferedAmount; } } -}); - - -// Expose W3C write/read attributes. -Object.defineProperties(WebSocket.prototype, { - binaryType: { - get: function() { - return this._binaryType; - }, - set: function(type) { - // TODO: Just 'arraybuffer' supported. - if (type !== 'arraybuffer') { - throw new SyntaxError('just "blob" type allowed for "binaryType" attribute'); - } - this._binaryType = type; - } - } -}); - - -// Expose W3C readyState constants. -[['CONNECTING',CONNECTING], ['OPEN',OPEN], ['CLOSING',CLOSING], ['CLOSED',CLOSED]].forEach(function(property) { - Object.defineProperty(WebSocket.prototype, property[0], { - get: function() { return property[1]; } - }); -}); - - -WebSocket.prototype.send = function(data) { - if (this._readyState !== OPEN) { - throw new Error('cannot call send() while not connected'); - } - - // Text. - if (typeof data === 'string' || data instanceof String) { - this._connection.sendUTF(data); - } - // Binary. - else { - // Node Buffer. - if (data instanceof Buffer) { - this._connection.sendBytes(data); - } - // If ArrayBuffer or ArrayBufferView convert it to Node Buffer. - else if (data.byteLength || data.byteLength === 0) { - data = toBuffer(data); - this._connection.sendBytes(data); - } - else { - throw new Error('unknown binary data:', data); - } - } -}; - - -WebSocket.prototype.close = function() { - switch(this._readyState) { - case CONNECTING: - // TODO: We don't have the WebSocketConnection instance yet so no - // way to close the TCP connection. - // Artificially invoke the onConnectFailed event. - onConnectFailed.call(this); - // And close if it connects after a while. - this._client.on('connect', function(connection) { - connection.close(); - }); - break; - case OPEN: - this._readyState = CLOSING; - this._connection.close(); - break; - case CLOSING: - case CLOSED: - break; - } -}; - - -/** - * Private API. - */ - - -function OpenEvent(target) { - this.type = 'open'; - this.target = target; -} - - -function ErrorEvent(target) { - this.type = 'error'; - this.target = target; -} - - -function CloseEvent(target, code, reason) { - this.type = 'close'; - this.target = target; - this.code = code; - this.reason = reason; - this.wasClean = (typeof code === 'undefined' || code === 1000); -} - - -function MessageEvent(target, data) { - this.type = 'message'; - this.target = target; - this.data = data; -} - - -function onConnect(connection) { - this._readyState = OPEN; - this._connection = connection; - this._protocol = connection.protocol; - this._extensions = connection.extensions; - - this._connection.on('close', onClose.bind(this)); - this._connection.on('message', onMessage.bind(this)); - - callListener.call(this, 'onopen', new OpenEvent(this)); -} - - -function onConnectFailed() { - destroy.call(this); - this._readyState = CLOSED; - - // Emit 'close' after 'error' even if 'error' listener throws. - global.setTimeout(function() { - callListener.call(this, 'onclose', new CloseEvent(this, 1006, 'connection failed')); - }.bind(this)); - callListener.call(this, 'onerror', new ErrorEvent(this)); -} - - -function onClose(code, reason) { - destroy.call(this); - this._readyState = CLOSED; - - callListener.call(this, 'onclose', new CloseEvent(this, code, reason || '')); -} - - -function onMessage(message) { - if (message.utf8Data) { - callListener.call(this, 'onmessage', new MessageEvent(this, message.utf8Data)); - } - else if (message.binaryData) { - // Must convert from Node Buffer to ArrayBuffer. - // TODO: or to a Blob (which does not exist in Node!). - if (this.binaryType === 'arraybuffer') { - var buffer = message.binaryData; - var arraybuffer = new ArrayBuffer(buffer.length); - var view = new Uint8Array(arraybuffer); - for (var i=0, len=buffer.length; i', '@', - ',', ';', ':', '\\', '\"', - '/', '[', ']', '?', '=', - '{', '}', ' ', String.fromCharCode(9) -]; - -function WebSocketClient(config) { - // Superclass Constructor - EventEmitter.call(this); - - // TODO: Implement extensions - - this.config = { - // 1MiB max frame size. - maxReceivedFrameSize: 0x100000, - - // 8MiB max message size, only applicable if - // assembleFragments is true - maxReceivedMessageSize: 0x800000, - - // Outgoing messages larger than fragmentationThreshold will be - // split into multiple fragments. - fragmentOutgoingMessages: true, - - // Outgoing frames are fragmented if they exceed this threshold. - // Default is 16KiB - fragmentationThreshold: 0x4000, - - // Which version of the protocol to use for this session. This - // option will be removed once the protocol is finalized by the IETF - // It is only available to ease the transition through the - // intermediate draft protocol versions. - // At present, it only affects the name of the Origin header. - webSocketVersion: 13, - - // If true, fragmented messages will be automatically assembled - // and the full message will be emitted via a 'message' event. - // If false, each frame will be emitted via a 'frame' event and - // the application will be responsible for aggregating multiple - // fragmented frames. Single-frame messages will emit a 'message' - // event in addition to the 'frame' event. - // Most users will want to leave this set to 'true' - assembleFragments: true, - - // The Nagle Algorithm makes more efficient use of network resources - // by introducing a small delay before sending small packets so that - // multiple messages can be batched together before going onto the - // wire. This however comes at the cost of latency, so the default - // is to disable it. If you don't need low latency and are streaming - // lots of small messages, you can change this to 'false' - disableNagleAlgorithm: true, - - // The number of milliseconds to wait after sending a close frame - // for an acknowledgement to come back before giving up and just - // closing the socket. - closeTimeout: 5000, - - // Options to pass to https.connect if connecting via TLS - tlsOptions: {} - }; - - if (config) { - var tlsOptions; - if (config.tlsOptions) { - tlsOptions = config.tlsOptions; - delete config.tlsOptions; - } - else { - tlsOptions = {}; - } - extend(this.config, config); - extend(this.config.tlsOptions, tlsOptions); - } - - this._req = null; - - switch (this.config.webSocketVersion) { - case 8: - case 13: - break; - default: - throw new Error('Requested webSocketVersion is not supported. Allowed values are 8 and 13.'); - } -} - -util.inherits(WebSocketClient, EventEmitter); - -WebSocketClient.prototype.connect = function(requestUrl, protocols, origin, headers, extraRequestOptions) { - var self = this; - if (typeof(protocols) === 'string') { - if (protocols.length > 0) { - protocols = [protocols]; - } - else { - protocols = []; - } - } - if (!(protocols instanceof Array)) { - protocols = []; - } - this.protocols = protocols; - this.origin = origin; - - if (typeof(requestUrl) === 'string') { - this.url = url.parse(requestUrl); - } - else { - this.url = requestUrl; // in case an already parsed url is passed in. - } - if (!this.url.protocol) { - throw new Error('You must specify a full WebSocket URL, including protocol.'); - } - if (!this.url.host) { - throw new Error('You must specify a full WebSocket URL, including hostname. Relative URLs are not supported.'); - } - - this.secure = (this.url.protocol === 'wss:'); - - // validate protocol characters: - this.protocols.forEach(function(protocol) { - for (var i=0; i < protocol.length; i ++) { - var charCode = protocol.charCodeAt(i); - var character = protocol.charAt(i); - if (charCode < 0x0021 || charCode > 0x007E || protocolSeparators.indexOf(character) !== -1) { - throw new Error('Protocol list contains invalid character "' + String.fromCharCode(charCode) + '"'); - } - } - }); - - var defaultPorts = { - 'ws:': '80', - 'wss:': '443' - }; - - if (!this.url.port) { - this.url.port = defaultPorts[this.url.protocol]; - } - - var nonce = new Buffer(16); - for (var i=0; i < 16; i++) { - nonce[i] = Math.round(Math.random()*0xFF); - } - this.base64nonce = nonce.toString('base64'); - - var hostHeaderValue = this.url.hostname; - if ((this.url.protocol === 'ws:' && this.url.port !== '80') || - (this.url.protocol === 'wss:' && this.url.port !== '443')) { - hostHeaderValue += (':' + this.url.port); - } - - var reqHeaders = headers || {}; - extend(reqHeaders, { - 'Upgrade': 'websocket', - 'Connection': 'Upgrade', - 'Sec-WebSocket-Version': this.config.webSocketVersion.toString(10), - 'Sec-WebSocket-Key': this.base64nonce, - 'Host': hostHeaderValue - }); - - if (this.protocols.length > 0) { - reqHeaders['Sec-WebSocket-Protocol'] = this.protocols.join(', '); - } - if (this.origin) { - if (this.config.webSocketVersion === 13) { - reqHeaders['Origin'] = this.origin; - } - else if (this.config.webSocketVersion === 8) { - reqHeaders['Sec-WebSocket-Origin'] = this.origin; - } - } - - // TODO: Implement extensions - - var pathAndQuery; - // Ensure it begins with '/'. - if (this.url.pathname) { - pathAndQuery = this.url.path; - } - else if (this.url.path) { - pathAndQuery = '/' + this.url.path; - } - else { - pathAndQuery = '/'; - } - - function handleRequestError(error) { - self._req = null; - self.emit('connectFailed', error); - } - - var requestOptions = { - agent: false - }; - if (extraRequestOptions) { - extend(requestOptions, extraRequestOptions); - } - // These options are always overridden by the library. The user is not - // allowed to specify these directly. - extend(requestOptions, { - hostname: this.url.hostname, - port: this.url.port, - method: 'GET', - path: pathAndQuery, - headers: reqHeaders - }); - if (this.secure) { - for (var key in self.config.tlsOptions) { - if (self.config.tlsOptions.hasOwnProperty(key)) { - requestOptions[key] = self.config.tlsOptions[key]; - } - } - } - - var req = this._req = (this.secure ? https : http).request(requestOptions); - req.on('upgrade', function handleRequestUpgrade(response, socket, head) { - self._req = null; - req.removeListener('error', handleRequestError); - self.socket = socket; - self.response = response; - self.firstDataChunk = head; - self.validateHandshake(); - }); - req.on('error', handleRequestError); - - req.on('response', function(response) { - self._req = null; - if (utils.eventEmitterListenerCount(self, 'httpResponse') > 0) { - self.emit('httpResponse', response, self); - if (response.socket) { - response.socket.end(); - } - } - else { - var headerDumpParts = []; - for (var headerName in response.headers) { - headerDumpParts.push(headerName + ': ' + response.headers[headerName]); - } - self.failHandshake( - 'Server responded with a non-101 status: ' + - response.statusCode + - '\nResponse Headers Follow:\n' + - headerDumpParts.join('\n') + '\n' - ); - } - }); - req.end(); -}; - -WebSocketClient.prototype.validateHandshake = function() { - var headers = this.response.headers; - - if (this.protocols.length > 0) { - this.protocol = headers['sec-websocket-protocol']; - if (this.protocol) { - if (this.protocols.indexOf(this.protocol) === -1) { - this.failHandshake('Server did not respond with a requested protocol.'); - return; - } - } - else { - this.failHandshake('Expected a Sec-WebSocket-Protocol header.'); - return; - } - } - - if (!(headers['connection'] && headers['connection'].toLocaleLowerCase() === 'upgrade')) { - this.failHandshake('Expected a Connection: Upgrade header from the server'); - return; - } - - if (!(headers['upgrade'] && headers['upgrade'].toLocaleLowerCase() === 'websocket')) { - this.failHandshake('Expected an Upgrade: websocket header from the server'); - return; - } - - var sha1 = crypto.createHash('sha1'); - sha1.update(this.base64nonce + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); - var expectedKey = sha1.digest('base64'); - - if (!headers['sec-websocket-accept']) { - this.failHandshake('Expected Sec-WebSocket-Accept header from server'); - return; - } - - if (headers['sec-websocket-accept'] !== expectedKey) { - this.failHandshake('Sec-WebSocket-Accept header from server didn\'t match expected value of ' + expectedKey); - return; - } - - // TODO: Support extensions - - this.succeedHandshake(); -}; - -WebSocketClient.prototype.failHandshake = function(errorDescription) { - if (this.socket && this.socket.writable) { - this.socket.end(); - } - this.emit('connectFailed', new Error(errorDescription)); -}; - -WebSocketClient.prototype.succeedHandshake = function() { - var connection = new WebSocketConnection(this.socket, [], this.protocol, true, this.config); - - connection.webSocketVersion = this.config.webSocketVersion; - connection._addSocketEventListeners(); - - this.emit('connect', connection); - if (this.firstDataChunk.length > 0) { - connection.handleSocketData(this.firstDataChunk); - } - this.firstDataChunk = null; -}; - -WebSocketClient.prototype.abort = function() { - if (this._req) { - this._req.abort(); - } -}; - -module.exports = WebSocketClient; diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketConnection.js b/s4t-server-python/node_modules/websocket/lib/WebSocketConnection.js deleted file mode 100644 index 901aedf..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketConnection.js +++ /dev/null @@ -1,858 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var util = require('util'); -var utils = require('./utils'); -var EventEmitter = require('events').EventEmitter; -var WebSocketFrame = require('./WebSocketFrame'); -var BufferList = require('../vendor/FastBufferList'); -var Validation = require('./Validation').Validation; - -// Connected, fully-open, ready to send and receive frames -const STATE_OPEN = 'open'; -// Received a close frame from the remote peer -const STATE_PEER_REQUESTED_CLOSE = 'peer_requested_close'; -// Sent close frame to remote peer. No further data can be sent. -const STATE_ENDING = 'ending'; -// Connection is fully closed. No further data can be sent or received. -const STATE_CLOSED = 'closed'; - -var setImmediateImpl = ('setImmediate' in global) ? - global.setImmediate.bind(global) : - process.nextTick.bind(process); - -var idCounter = 0; - -function WebSocketConnection(socket, extensions, protocol, maskOutgoingPackets, config) { - this._debug = utils.BufferingLogger('websocket:connection', ++idCounter); - this._debug('constructor'); - - if (this._debug.enabled) { - instrumentSocketForDebugging(this, socket); - } - - // Superclass Constructor - EventEmitter.call(this); - - this.config = config; - this.socket = socket; - this.protocol = protocol; - this.extensions = extensions; - this.remoteAddress = socket.remoteAddress; - this.closeReasonCode = -1; - this.closeDescription = null; - this.closeEventEmitted = false; - - // We have to mask outgoing packets if we're acting as a WebSocket client. - this.maskOutgoingPackets = maskOutgoingPackets; - - // We re-use the same buffers for the mask and frame header for all frames - // received on each connection to avoid a small memory allocation for each - // frame. - this.maskBytes = new Buffer(4); - this.frameHeader = new Buffer(10); - - // the BufferList will handle the data streaming in - this.bufferList = new BufferList(); - - // Prepare for receiving first frame - this.currentFrame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - this.fragmentationSize = 0; // data received so far... - this.frameQueue = []; - - // Various bits of connection state - this.connected = true; - this.state = STATE_OPEN; - this.waitingForCloseResponse = false; - // Received TCP FIN, socket's readable stream is finished. - this.receivedEnd = false; - - this.closeTimeout = this.config.closeTimeout; - this.assembleFragments = this.config.assembleFragments; - this.maxReceivedMessageSize = this.config.maxReceivedMessageSize; - - this.outputBufferFull = false; - this.inputPaused = false; - this.receivedDataHandler = this.processReceivedData.bind(this); - this._closeTimerHandler = this.handleCloseTimer.bind(this); - - // Disable nagle algorithm? - this.socket.setNoDelay(this.config.disableNagleAlgorithm); - - // Make sure there is no socket inactivity timeout - this.socket.setTimeout(0); - - if (this.config.keepalive && !this.config.useNativeKeepalive) { - if (typeof(this.config.keepaliveInterval) !== 'number') { - throw new Error('keepaliveInterval must be specified and numeric ' + - 'if keepalive is true.'); - } - this._keepaliveTimerHandler = this.handleKeepaliveTimer.bind(this); - this.setKeepaliveTimer(); - - if (this.config.dropConnectionOnKeepaliveTimeout) { - if (typeof(this.config.keepaliveGracePeriod) !== 'number') { - throw new Error('keepaliveGracePeriod must be specified and ' + - 'numeric if dropConnectionOnKeepaliveTimeout ' + - 'is true.'); - } - this._gracePeriodTimerHandler = this.handleGracePeriodTimer.bind(this); - } - } - else if (this.config.keepalive && this.config.useNativeKeepalive) { - if (!('setKeepAlive' in this.socket)) { - throw new Error('Unable to use native keepalive: unsupported by ' + - 'this version of Node.'); - } - this.socket.setKeepAlive(true, this.config.keepaliveInterval); - } - - // The HTTP Client seems to subscribe to socket error events - // and re-dispatch them in such a way that doesn't make sense - // for users of our client, so we want to make sure nobody - // else is listening for error events on the socket besides us. - this.socket.removeAllListeners('error'); -} - -WebSocketConnection.CLOSE_REASON_NORMAL = 1000; -WebSocketConnection.CLOSE_REASON_GOING_AWAY = 1001; -WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR = 1002; -WebSocketConnection.CLOSE_REASON_UNPROCESSABLE_INPUT = 1003; -WebSocketConnection.CLOSE_REASON_RESERVED = 1004; // Reserved value. Undefined meaning. -WebSocketConnection.CLOSE_REASON_NOT_PROVIDED = 1005; // Not to be used on the wire -WebSocketConnection.CLOSE_REASON_ABNORMAL = 1006; // Not to be used on the wire -WebSocketConnection.CLOSE_REASON_INVALID_DATA = 1007; -WebSocketConnection.CLOSE_REASON_POLICY_VIOLATION = 1008; -WebSocketConnection.CLOSE_REASON_MESSAGE_TOO_BIG = 1009; -WebSocketConnection.CLOSE_REASON_EXTENSION_REQUIRED = 1010; -WebSocketConnection.CLOSE_REASON_INTERNAL_SERVER_ERROR = 1011; -WebSocketConnection.CLOSE_REASON_TLS_HANDSHAKE_FAILED = 1015; // Not to be used on the wire - -WebSocketConnection.CLOSE_DESCRIPTIONS = { - 1000: 'Normal connection closure', - 1001: 'Remote peer is going away', - 1002: 'Protocol error', - 1003: 'Unprocessable input', - 1004: 'Reserved', - 1005: 'Reason not provided', - 1006: 'Abnormal closure, no further detail available', - 1007: 'Invalid data received', - 1008: 'Policy violation', - 1009: 'Message too big', - 1010: 'Extension requested by client is required', - 1011: 'Internal Server Error', - 1015: 'TLS Handshake Failed' -}; - -function validateCloseReason(code) { - if (code < 1000) { - // Status codes in the range 0-999 are not used - return false; - } - if (code >= 1000 && code <= 2999) { - // Codes from 1000 - 2999 are reserved for use by the protocol. Only - // a few codes are defined, all others are currently illegal. - return [1000, 1001, 1002, 1003, 1007, 1008, 1009, 1010, 1011].indexOf(code) !== -1; - } - if (code >= 3000 && code <= 3999) { - // Reserved for use by libraries, frameworks, and applications. - // Should be registered with IANA. Interpretation of these codes is - // undefined by the WebSocket protocol. - return true; - } - if (code >= 4000 && code <= 4999) { - // Reserved for private use. Interpretation of these codes is - // undefined by the WebSocket protocol. - return true; - } - if (code >= 5000) { - return false; - } -} - -util.inherits(WebSocketConnection, EventEmitter); - -WebSocketConnection.prototype._addSocketEventListeners = function() { - this.socket.on('error', this.handleSocketError.bind(this)); - this.socket.on('end', this.handleSocketEnd.bind(this)); - this.socket.on('close', this.handleSocketClose.bind(this)); - this.socket.on('drain', this.handleSocketDrain.bind(this)); - this.socket.on('pause', this.handleSocketPause.bind(this)); - this.socket.on('resume', this.handleSocketResume.bind(this)); - this.socket.on('data', this.handleSocketData.bind(this)); -}; - -// set or reset the keepalive timer when data is received. -WebSocketConnection.prototype.setKeepaliveTimer = function() { - this._debug('setKeepaliveTimer'); - if (!this.config.keepalive) { return; } - this.clearKeepaliveTimer(); - this.clearGracePeriodTimer(); - this._keepaliveTimeoutID = setTimeout(this._keepaliveTimerHandler, this.config.keepaliveInterval); -}; - -WebSocketConnection.prototype.clearKeepaliveTimer = function() { - if (this._keepaliveTimeoutID) { - clearTimeout(this._keepaliveTimeoutID); - } -}; - -// No data has been received within config.keepaliveTimeout ms. -WebSocketConnection.prototype.handleKeepaliveTimer = function() { - this._debug('handleKeepaliveTimer'); - this._keepaliveTimeoutID = null; - this.ping(); - - // If we are configured to drop connections if the client doesn't respond - // then set the grace period timer. - if (this.config.dropConnectionOnKeepaliveTimeout) { - this.setGracePeriodTimer(); - } - else { - // Otherwise reset the keepalive timer to send the next ping. - this.setKeepaliveTimer(); - } -}; - -WebSocketConnection.prototype.setGracePeriodTimer = function() { - this._debug('setGracePeriodTimer'); - this.clearGracePeriodTimer(); - this._gracePeriodTimeoutID = setTimeout(this._gracePeriodTimerHandler, this.config.keepaliveGracePeriod); -}; - -WebSocketConnection.prototype.clearGracePeriodTimer = function() { - if (this._gracePeriodTimeoutID) { - clearTimeout(this._gracePeriodTimeoutID); - } -}; - -WebSocketConnection.prototype.handleGracePeriodTimer = function() { - this._debug('handleGracePeriodTimer'); - // If this is called, the client has not responded and is assumed dead. - this._gracePeriodTimeoutID = null; - this.drop(WebSocketConnection.CLOSE_REASON_ABNORMAL, 'Peer not responding.', true); -}; - -WebSocketConnection.prototype.handleSocketData = function(data) { - this._debug('handleSocketData'); - // Reset the keepalive timer when receiving data of any kind. - this.setKeepaliveTimer(); - - // Add received data to our bufferList, which efficiently holds received - // data chunks in a linked list of Buffer objects. - this.bufferList.write(data); - - this.processReceivedData(); -}; - -WebSocketConnection.prototype.processReceivedData = function() { - this._debug('processReceivedData'); - // If we're not connected, we should ignore any data remaining on the buffer. - if (!this.connected) { return; } - - // Receiving/parsing is expected to be halted when paused. - if (this.inputPaused) { return; } - - var frame = this.currentFrame; - - // WebSocketFrame.prototype.addData returns true if all data necessary to - // parse the frame was available. It returns false if we are waiting for - // more data to come in on the wire. - if (!frame.addData(this.bufferList)) { this._debug('-- insufficient data for frame'); return; } - - var self = this; - - // Handle possible parsing errors - if (frame.protocolError) { - // Something bad happened.. get rid of this client. - this._debug('-- protocol error'); - process.nextTick(function() { - self.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, frame.dropReason); - }); - return; - } - else if (frame.frameTooLarge) { - this._debug('-- frame too large'); - process.nextTick(function() { - self.drop(WebSocketConnection.CLOSE_REASON_MESSAGE_TOO_BIG, frame.dropReason); - }); - return; - } - - // For now since we don't support extensions, all RSV bits are illegal - if (frame.rsv1 || frame.rsv2 || frame.rsv3) { - this._debug('-- illegal rsv flag'); - process.nextTick(function() { - self.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, - 'Unsupported usage of rsv bits without negotiated extension.'); - }); - return; - } - - if (!this.assembleFragments) { - this._debug('-- emitting frame'); - process.nextTick(function() { self.emit('frame', frame); }); - } - - process.nextTick(function() { self.processFrame(frame); }); - - this.currentFrame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - - // If there's data remaining, schedule additional processing, but yield - // for now so that other connections have a chance to have their data - // processed. We use setImmediate here instead of process.nextTick to - // explicitly indicate that we wish for other I/O to be handled first. - if (this.bufferList.length > 0) { - setImmediateImpl(this.receivedDataHandler); - } -}; - -WebSocketConnection.prototype.handleSocketError = function(error) { - this._debug('handleSocketError: %j', error); - this.closeReasonCode = WebSocketConnection.CLOSE_REASON_ABNORMAL; - this.closeDescription = 'Socket Error: ' + error.syscall + ' ' + error.code; - this.connected = false; - this.state = STATE_CLOSED; - this.fragmentationSize = 0; - if (utils.eventEmitterListenerCount(this, 'error') > 0) { - this.emit('error', error); - } - this.socket.destroy(error); - this._debug.printOutput(); -}; - -WebSocketConnection.prototype.handleSocketEnd = function() { - this._debug('handleSocketEnd: received socket end. state = %s', this.state); - this.receivedEnd = true; - if (this.state === STATE_CLOSED) { - // When using the TLS module, sometimes the socket will emit 'end' - // after it emits 'close'. I don't think that's correct behavior, - // but we should deal with it gracefully by ignoring it. - this._debug(' --- Socket \'end\' after \'close\''); - return; - } - if (this.state !== STATE_PEER_REQUESTED_CLOSE && - this.state !== STATE_ENDING) { - this._debug(' --- UNEXPECTED socket end.'); - this.socket.end(); - } -}; - -WebSocketConnection.prototype.handleSocketClose = function(hadError) { - this._debug('handleSocketClose: received socket close'); - this.socketHadError = hadError; - this.connected = false; - this.state = STATE_CLOSED; - // If closeReasonCode is still set to -1 at this point then we must - // not have received a close frame!! - if (this.closeReasonCode === -1) { - this.closeReasonCode = WebSocketConnection.CLOSE_REASON_ABNORMAL; - this.closeDescription = 'Connection dropped by remote peer.'; - } - this.clearCloseTimer(); - this.clearKeepaliveTimer(); - this.clearGracePeriodTimer(); - if (!this.closeEventEmitted) { - this.closeEventEmitted = true; - this._debug('-- Emitting WebSocketConnection close event'); - this.emit('close', this.closeReasonCode, this.closeDescription); - } -}; - -WebSocketConnection.prototype.handleSocketDrain = function() { - this._debug('handleSocketDrain: socket drain event'); - this.outputBufferFull = false; - this.emit('drain'); -}; - -WebSocketConnection.prototype.handleSocketPause = function() { - this._debug('handleSocketPause: socket pause event'); - this.inputPaused = true; - this.emit('pause'); -}; - -WebSocketConnection.prototype.handleSocketResume = function() { - this._debug('handleSocketResume: socket resume event'); - this.inputPaused = false; - this.emit('resume'); - this.processReceivedData(); -}; - -WebSocketConnection.prototype.pause = function() { - this._debug('pause: pause requested'); - this.socket.pause(); -}; - -WebSocketConnection.prototype.resume = function() { - this._debug('resume: resume requested'); - this.socket.resume(); -}; - -WebSocketConnection.prototype.close = function(reasonCode, description) { - if (this.connected) { - this._debug('close: Initating clean WebSocket close sequence.'); - if ('number' !== typeof reasonCode) { - reasonCode = WebSocketConnection.CLOSE_REASON_NORMAL; - } - if (!validateCloseReason(reasonCode)) { - throw new Error('Close code ' + reasonCode + ' is not valid.'); - } - if ('string' !== typeof description) { - description = WebSocketConnection.CLOSE_DESCRIPTIONS[reasonCode]; - } - this.closeReasonCode = reasonCode; - this.closeDescription = description; - this.setCloseTimer(); - this.sendCloseFrame(this.closeReasonCode, this.closeDescription); - this.state = STATE_ENDING; - this.connected = false; - } -}; - -WebSocketConnection.prototype.drop = function(reasonCode, description, skipCloseFrame) { - this._debug('drop'); - if (typeof(reasonCode) !== 'number') { - reasonCode = WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR; - } - - if (typeof(description) !== 'string') { - // If no description is provided, try to look one up based on the - // specified reasonCode. - description = WebSocketConnection.CLOSE_DESCRIPTIONS[reasonCode]; - } - - this._debug('Forcefully dropping connection. skipCloseFrame: %s, code: %d, description: %s', - skipCloseFrame, reasonCode, description - ); - - this.closeReasonCode = reasonCode; - this.closeDescription = description; - this.frameQueue = []; - this.fragmentationSize = 0; - if (!skipCloseFrame) { - this.sendCloseFrame(reasonCode, description); - } - this.connected = false; - this.state = STATE_CLOSED; - this.clearCloseTimer(); - this.clearKeepaliveTimer(); - this.clearGracePeriodTimer(); - - if (!this.closeEventEmitted) { - this.closeEventEmitted = true; - this._debug('Emitting WebSocketConnection close event'); - this.emit('close', this.closeReasonCode, this.closeDescription); - } - - this._debug('Drop: destroying socket'); - this.socket.destroy(); -}; - -WebSocketConnection.prototype.setCloseTimer = function() { - this._debug('setCloseTimer'); - this.clearCloseTimer(); - this._debug('Setting close timer'); - this.waitingForCloseResponse = true; - this.closeTimer = setTimeout(this._closeTimerHandler, this.closeTimeout); -}; - -WebSocketConnection.prototype.clearCloseTimer = function() { - this._debug('clearCloseTimer'); - if (this.closeTimer) { - this._debug('Clearing close timer'); - clearTimeout(this.closeTimer); - this.waitingForCloseResponse = false; - this.closeTimer = null; - } -}; - -WebSocketConnection.prototype.handleCloseTimer = function() { - this._debug('handleCloseTimer'); - this.closeTimer = null; - if (this.waitingForCloseResponse) { - this._debug('Close response not received from client. Forcing socket end.'); - this.waitingForCloseResponse = false; - this.state = STATE_CLOSED; - this.socket.end(); - } -}; - -WebSocketConnection.prototype.processFrame = function(frame) { - this._debug('processFrame'); - this._debug(' -- frame: %s', frame); - - // Any non-control opcode besides 0x00 (continuation) received in the - // middle of a fragmented message is illegal. - if (this.frameQueue.length !== 0 && (frame.opcode > 0x00 && frame.opcode < 0x08)) { - this.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, - 'Illegal frame opcode 0x' + frame.opcode.toString(16) + ' ' + - 'received in middle of fragmented message.'); - return; - } - - switch(frame.opcode) { - case 0x02: // WebSocketFrame.BINARY_FRAME - this._debug('-- Binary Frame'); - if (this.assembleFragments) { - if (frame.fin) { - // Complete single-frame message received - this._debug('---- Emitting \'message\' event'); - this.emit('message', { - type: 'binary', - binaryData: frame.binaryPayload - }); - } - else { - // beginning of a fragmented message - this.frameQueue.push(frame); - this.fragmentationSize = frame.length; - } - } - break; - case 0x01: // WebSocketFrame.TEXT_FRAME - this._debug('-- Text Frame'); - if (this.assembleFragments) { - if (frame.fin) { - if (!Validation.isValidUTF8(frame.binaryPayload)) { - this.drop(WebSocketConnection.CLOSE_REASON_INVALID_DATA, - 'Invalid UTF-8 Data Received'); - return; - } - // Complete single-frame message received - this._debug('---- Emitting \'message\' event'); - this.emit('message', { - type: 'utf8', - utf8Data: frame.binaryPayload.toString('utf8') - }); - } - else { - // beginning of a fragmented message - this.frameQueue.push(frame); - this.fragmentationSize = frame.length; - } - } - break; - case 0x00: // WebSocketFrame.CONTINUATION - this._debug('-- Continuation Frame'); - if (this.assembleFragments) { - if (this.frameQueue.length === 0) { - this.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, - 'Unexpected Continuation Frame'); - return; - } - - this.fragmentationSize += frame.length; - - if (this.fragmentationSize > this.maxReceivedMessageSize) { - this.drop(WebSocketConnection.CLOSE_REASON_MESSAGE_TOO_BIG, - 'Maximum message size exceeded.'); - return; - } - - this.frameQueue.push(frame); - - if (frame.fin) { - // end of fragmented message, so we process the whole - // message now. We also have to decode the utf-8 data - // for text frames after combining all the fragments. - var bytesCopied = 0; - var binaryPayload = new Buffer(this.fragmentationSize); - var opcode = this.frameQueue[0].opcode; - this.frameQueue.forEach(function (currentFrame) { - currentFrame.binaryPayload.copy(binaryPayload, bytesCopied); - bytesCopied += currentFrame.binaryPayload.length; - }); - this.frameQueue = []; - this.fragmentationSize = 0; - - switch (opcode) { - case 0x02: // WebSocketOpcode.BINARY_FRAME - this.emit('message', { - type: 'binary', - binaryData: binaryPayload - }); - break; - case 0x01: // WebSocketOpcode.TEXT_FRAME - if (!Validation.isValidUTF8(binaryPayload)) { - this.drop(WebSocketConnection.CLOSE_REASON_INVALID_DATA, - 'Invalid UTF-8 Data Received'); - return; - } - this.emit('message', { - type: 'utf8', - utf8Data: binaryPayload.toString('utf8') - }); - break; - default: - this.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, - 'Unexpected first opcode in fragmentation sequence: 0x' + opcode.toString(16)); - return; - } - } - } - break; - case 0x09: // WebSocketFrame.PING - this._debug('-- Ping Frame'); - this.pong(frame.binaryPayload); - break; - case 0x0A: // WebSocketFrame.PONG - this._debug('-- Pong Frame'); - break; - case 0x08: // WebSocketFrame.CONNECTION_CLOSE - this._debug('-- Close Frame'); - if (this.waitingForCloseResponse) { - // Got response to our request to close the connection. - // Close is complete, so we just hang up. - this._debug('---- Got close response from peer. Completing closing handshake.'); - this.clearCloseTimer(); - this.waitingForCloseResponse = false; - this.state = STATE_CLOSED; - this.socket.end(); - return; - } - - this._debug('---- Closing handshake initiated by peer.'); - // Got request from other party to close connection. - // Send back acknowledgement and then hang up. - this.state = STATE_PEER_REQUESTED_CLOSE; - var respondCloseReasonCode; - - // Make sure the close reason provided is legal according to - // the protocol spec. Providing no close status is legal. - // WebSocketFrame sets closeStatus to -1 by default, so if it - // is still -1, then no status was provided. - if (frame.invalidCloseFrameLength) { - this.closeReasonCode = 1005; // 1005 = No reason provided. - respondCloseReasonCode = WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR; - } - else if (frame.closeStatus === -1 || validateCloseReason(frame.closeStatus)) { - this.closeReasonCode = frame.closeStatus; - respondCloseReasonCode = WebSocketConnection.CLOSE_REASON_NORMAL; - } - else { - this.closeReasonCode = frame.closeStatus; - respondCloseReasonCode = WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR; - } - - // If there is a textual description in the close frame, extract it. - if (frame.binaryPayload.length > 1) { - if (!Validation.isValidUTF8(frame.binaryPayload)) { - this.drop(WebSocketConnection.CLOSE_REASON_INVALID_DATA, - 'Invalid UTF-8 Data Received'); - return; - } - this.closeDescription = frame.binaryPayload.toString('utf8'); - } - else { - this.closeDescription = WebSocketConnection.CLOSE_DESCRIPTIONS[this.closeReasonCode]; - } - this._debug( - '------ Remote peer %s - code: %d - %s - close frame payload length: %d', - this.remoteAddress, this.closeReasonCode, - this.closeDescription, frame.length - ); - this._debug('------ responding to remote peer\'s close request.'); - this.sendCloseFrame(respondCloseReasonCode, null); - this.connected = false; - break; - default: - this._debug('-- Unrecognized Opcode %d', frame.opcode); - this.drop(WebSocketConnection.CLOSE_REASON_PROTOCOL_ERROR, - 'Unrecognized Opcode: 0x' + frame.opcode.toString(16)); - break; - } -}; - -WebSocketConnection.prototype.send = function(data, cb) { - this._debug('send'); - if (Buffer.isBuffer(data)) { - this.sendBytes(data, cb); - } - else if (typeof(data['toString']) === 'function') { - this.sendUTF(data, cb); - } - else { - throw new Error('Data provided must either be a Node Buffer or implement toString()'); - } -}; - -WebSocketConnection.prototype.sendUTF = function(data, cb) { - this._debug('sendUTF: %s', data.slice(0,80) + '|...'); - var frame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - frame.opcode = 0x01; // WebSocketOpcode.TEXT_FRAME - frame.binaryPayload = new Buffer(data.toString(), 'utf8'); - this.fragmentAndSend(frame, cb); -}; - -WebSocketConnection.prototype.sendBytes = function(data, cb) { - this._debug('sendBytes'); - if (!Buffer.isBuffer(data)) { - throw new Error('You must pass a Node Buffer object to WebSocketConnection.prototype.sendBytes()'); - } - var frame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - frame.opcode = 0x02; // WebSocketOpcode.BINARY_FRAME - frame.binaryPayload = data; - this.fragmentAndSend(frame, cb); -}; - -WebSocketConnection.prototype.ping = function(data) { - this._debug('ping'); - var frame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - frame.opcode = 0x09; // WebSocketOpcode.PING - frame.fin = true; - if (data) { - if (!Buffer.isBuffer(data)) { - data = new Buffer(data.toString(), 'utf8'); - } - if (data.length > 125) { - this._debug('WebSocket: Data for ping is longer than 125 bytes. Truncating.'); - data = data.slice(0,124); - } - frame.binaryPayload = data; - } - this.sendFrame(frame); -}; - -// Pong frames have to echo back the contents of the data portion of the -// ping frame exactly, byte for byte. -WebSocketConnection.prototype.pong = function(binaryPayload) { - this._debug('pong'); - var frame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - frame.opcode = 0x0A; // WebSocketOpcode.PONG - if (Buffer.isBuffer(binaryPayload) && binaryPayload.length > 125) { - this._debug('WebSocket: Data for pong is longer than 125 bytes. Truncating.'); - binaryPayload = binaryPayload.slice(0,124); - } - frame.binaryPayload = binaryPayload; - frame.fin = true; - this.sendFrame(frame); -}; - -WebSocketConnection.prototype.fragmentAndSend = function(frame, cb) { - this._debug('fragmentAndSend'); - if (frame.opcode > 0x07) { - throw new Error('You cannot fragment control frames.'); - } - - var threshold = this.config.fragmentationThreshold; - var length = frame.binaryPayload.length; - - // Send immediately if fragmentation is disabled or the message is not - // larger than the fragmentation threshold. - if (!this.config.fragmentOutgoingMessages || (frame.binaryPayload && length <= threshold)) { - frame.fin = true; - this.sendFrame(frame, cb); - return; - } - - var numFragments = Math.ceil(length / threshold); - var sentFragments = 0; - var sentCallback = function fragmentSentCallback(err) { - if (err) { - if (typeof cb === 'function') { - // pass only the first error - cb(err); - cb = null; - } - return; - } - ++sentFragments; - if ((sentFragments === numFragments) && (typeof cb === 'function')) { - cb(); - } - }; - for (var i=1; i <= numFragments; i++) { - var currentFrame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - - // continuation opcode except for first frame. - currentFrame.opcode = (i === 1) ? frame.opcode : 0x00; - - // fin set on last frame only - currentFrame.fin = (i === numFragments); - - // length is likely to be shorter on the last fragment - var currentLength = (i === numFragments) ? length - (threshold * (i-1)) : threshold; - var sliceStart = threshold * (i-1); - - // Slice the right portion of the original payload - currentFrame.binaryPayload = frame.binaryPayload.slice(sliceStart, sliceStart + currentLength); - - this.sendFrame(currentFrame, sentCallback); - } -}; - -WebSocketConnection.prototype.sendCloseFrame = function(reasonCode, description, cb) { - if (typeof(reasonCode) !== 'number') { - reasonCode = WebSocketConnection.CLOSE_REASON_NORMAL; - } - - this._debug('sendCloseFrame state: %s, reasonCode: %d, description: %s', this.state, reasonCode, description); - - if (this.state !== STATE_OPEN && this.state !== STATE_PEER_REQUESTED_CLOSE) { return; } - - var frame = new WebSocketFrame(this.maskBytes, this.frameHeader, this.config); - frame.fin = true; - frame.opcode = 0x08; // WebSocketOpcode.CONNECTION_CLOSE - frame.closeStatus = reasonCode; - if (typeof(description) === 'string') { - frame.binaryPayload = new Buffer(description, 'utf8'); - } - - this.sendFrame(frame, cb); - this.socket.end(); -}; - -WebSocketConnection.prototype.sendFrame = function(frame, cb) { - this._debug('sendFrame'); - frame.mask = this.maskOutgoingPackets; - var flushed = this.socket.write(frame.toBuffer(), cb); - this.outputBufferFull = !flushed; - return flushed; -}; - -module.exports = WebSocketConnection; - - - -function instrumentSocketForDebugging(connection, socket) { - /* jshint loopfunc: true */ - if (!connection._debug.enabled) { return; } - - var originalSocketEmit = socket.emit; - socket.emit = function(event) { - connection._debug('||| Socket Event \'%s\'', event); - originalSocketEmit.apply(this, arguments); - }; - - for (var key in socket) { - if ('function' !== typeof(socket[key])) { continue; } - if (['emit'].indexOf(key) !== -1) { continue; } - (function(key) { - var original = socket[key]; - if (key === 'on') { - socket[key] = function proxyMethod__EventEmitter__On() { - connection._debug('||| Socket method called: %s (%s)', key, arguments[0]); - return original.apply(this, arguments); - }; - return; - } - socket[key] = function proxyMethod() { - connection._debug('||| Socket method called: %s', key); - return original.apply(this, arguments); - }; - })(key); - } -} diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketFrame.js b/s4t-server-python/node_modules/websocket/lib/WebSocketFrame.js deleted file mode 100644 index 3573c37..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketFrame.js +++ /dev/null @@ -1,279 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var bufferUtil = require('./BufferUtil').BufferUtil; - -const DECODE_HEADER = 1; -const WAITING_FOR_16_BIT_LENGTH = 2; -const WAITING_FOR_64_BIT_LENGTH = 3; -const WAITING_FOR_MASK_KEY = 4; -const WAITING_FOR_PAYLOAD = 5; -const COMPLETE = 6; - -// WebSocketConnection will pass shared buffer objects for maskBytes and -// frameHeader into the constructor to avoid tons of small memory allocations -// for each frame we have to parse. This is only used for parsing frames -// we receive off the wire. -function WebSocketFrame(maskBytes, frameHeader, config) { - this.maskBytes = maskBytes; - this.frameHeader = frameHeader; - this.config = config; - this.maxReceivedFrameSize = config.maxReceivedFrameSize; - this.protocolError = false; - this.frameTooLarge = false; - this.invalidCloseFrameLength = false; - this.parseState = DECODE_HEADER; - this.closeStatus = -1; -} - -WebSocketFrame.prototype.addData = function(bufferList) { - if (this.parseState === DECODE_HEADER) { - if (bufferList.length >= 2) { - bufferList.joinInto(this.frameHeader, 0, 0, 2); - bufferList.advance(2); - var firstByte = this.frameHeader[0]; - var secondByte = this.frameHeader[1]; - - this.fin = Boolean(firstByte & 0x80); - this.rsv1 = Boolean(firstByte & 0x40); - this.rsv2 = Boolean(firstByte & 0x20); - this.rsv3 = Boolean(firstByte & 0x10); - this.mask = Boolean(secondByte & 0x80); - - this.opcode = firstByte & 0x0F; - this.length = secondByte & 0x7F; - - // Control frame sanity check - if (this.opcode >= 0x08) { - if (this.length > 125) { - this.protocolError = true; - this.dropReason = 'Illegal control frame longer than 125 bytes.'; - return true; - } - if (!this.fin) { - this.protocolError = true; - this.dropReason = 'Control frames must not be fragmented.'; - return true; - } - } - - if (this.length === 126) { - this.parseState = WAITING_FOR_16_BIT_LENGTH; - } - else if (this.length === 127) { - this.parseState = WAITING_FOR_64_BIT_LENGTH; - } - else { - this.parseState = WAITING_FOR_MASK_KEY; - } - } - } - if (this.parseState === WAITING_FOR_16_BIT_LENGTH) { - if (bufferList.length >= 2) { - bufferList.joinInto(this.frameHeader, 2, 0, 2); - bufferList.advance(2); - this.length = this.frameHeader.readUInt16BE(2, true); - this.parseState = WAITING_FOR_MASK_KEY; - } - } - else if (this.parseState === WAITING_FOR_64_BIT_LENGTH) { - if (bufferList.length >= 8) { - bufferList.joinInto(this.frameHeader, 2, 0, 8); - bufferList.advance(8); - var lengthPair = [ - this.frameHeader.readUInt32BE(2, true), - this.frameHeader.readUInt32BE(2+4, true) - ]; - - if (lengthPair[0] !== 0) { - this.protocolError = true; - this.dropReason = 'Unsupported 64-bit length frame received'; - return true; - } - this.length = lengthPair[1]; - this.parseState = WAITING_FOR_MASK_KEY; - } - } - - if (this.parseState === WAITING_FOR_MASK_KEY) { - if (this.mask) { - if (bufferList.length >= 4) { - bufferList.joinInto(this.maskBytes, 0, 0, 4); - bufferList.advance(4); - this.parseState = WAITING_FOR_PAYLOAD; - } - } - else { - this.parseState = WAITING_FOR_PAYLOAD; - } - } - - if (this.parseState === WAITING_FOR_PAYLOAD) { - if (this.length > this.maxReceivedFrameSize) { - this.frameTooLarge = true; - this.dropReason = 'Frame size of ' + this.length.toString(10) + - ' bytes exceeds maximum accepted frame size'; - return true; - } - - if (this.length === 0) { - this.binaryPayload = new Buffer(0); - this.parseState = COMPLETE; - return true; - } - if (bufferList.length >= this.length) { - this.binaryPayload = bufferList.take(this.length); - bufferList.advance(this.length); - if (this.mask) { - bufferUtil.unmask(this.binaryPayload, this.maskBytes); - // xor(this.binaryPayload, this.maskBytes, 0); - } - - if (this.opcode === 0x08) { // WebSocketOpcode.CONNECTION_CLOSE - if (this.length === 1) { - // Invalid length for a close frame. Must be zero or at least two. - this.binaryPayload = new Buffer(0); - this.invalidCloseFrameLength = true; - } - if (this.length >= 2) { - this.closeStatus = this.binaryPayload.readUInt16BE(0, true); - this.binaryPayload = this.binaryPayload.slice(2); - } - } - - this.parseState = COMPLETE; - return true; - } - } - return false; -}; - -WebSocketFrame.prototype.throwAwayPayload = function(bufferList) { - if (bufferList.length >= this.length) { - bufferList.advance(this.length); - this.parseState = COMPLETE; - return true; - } - return false; -}; - -WebSocketFrame.prototype.toBuffer = function(nullMask) { - var maskKey; - var headerLength = 2; - var data; - var outputPos; - var firstByte = 0x00; - var secondByte = 0x00; - - if (this.fin) { - firstByte |= 0x80; - } - if (this.rsv1) { - firstByte |= 0x40; - } - if (this.rsv2) { - firstByte |= 0x20; - } - if (this.rsv3) { - firstByte |= 0x10; - } - if (this.mask) { - secondByte |= 0x80; - } - - firstByte |= (this.opcode & 0x0F); - - // the close frame is a special case because the close reason is - // prepended to the payload data. - if (this.opcode === 0x08) { - this.length = 2; - if (this.binaryPayload) { - this.length += this.binaryPayload.length; - } - data = new Buffer(this.length); - data.writeUInt16BE(this.closeStatus, 0, true); - if (this.length > 2) { - this.binaryPayload.copy(data, 2); - } - } - else if (this.binaryPayload) { - data = this.binaryPayload; - this.length = data.length; - } - else { - this.length = 0; - } - - if (this.length <= 125) { - // encode the length directly into the two-byte frame header - secondByte |= (this.length & 0x7F); - } - else if (this.length > 125 && this.length <= 0xFFFF) { - // Use 16-bit length - secondByte |= 126; - headerLength += 2; - } - else if (this.length > 0xFFFF) { - // Use 64-bit length - secondByte |= 127; - headerLength += 8; - } - - var output = new Buffer(this.length + headerLength + (this.mask ? 4 : 0)); - - // write the frame header - output[0] = firstByte; - output[1] = secondByte; - - outputPos = 2; - - if (this.length > 125 && this.length <= 0xFFFF) { - // write 16-bit length - output.writeUInt16BE(this.length, outputPos, true); - outputPos += 2; - } - else if (this.length > 0xFFFF) { - // write 64-bit length - output.writeUInt32BE(0x00000000, outputPos, true); - output.writeUInt32BE(this.length, outputPos + 4, true); - outputPos += 8; - } - - if (this.mask) { - maskKey = nullMask ? 0 : (Math.random()*0xFFFFFFFF) | 0; - this.maskBytes.writeUInt32BE(maskKey, 0, true); - - // write the mask key - this.maskBytes.copy(output, outputPos); - outputPos += 4; - - if (data) { - bufferUtil.mask(data, this.maskBytes, output, outputPos, this.length); - } - } - else if (data) { - data.copy(output, outputPos); - } - - return output; -}; - -WebSocketFrame.prototype.toString = function() { - return 'Opcode: ' + this.opcode + ', fin: ' + this.fin + ', length: ' + this.length + ', hasPayload: ' + Boolean(this.binaryPayload) + ', masked: ' + this.mask; -}; - - -module.exports = WebSocketFrame; diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketRequest.js b/s4t-server-python/node_modules/websocket/lib/WebSocketRequest.js deleted file mode 100644 index c2145b9..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketRequest.js +++ /dev/null @@ -1,524 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var crypto = require('crypto'); -var util = require('util'); -var url = require('url'); -var EventEmitter = require('events').EventEmitter; -var WebSocketConnection = require('./WebSocketConnection'); - -var headerValueSplitRegExp = /,\s*/; -var headerParamSplitRegExp = /;\s*/; -var headerSanitizeRegExp = /[\r\n]/g; -var xForwardedForSeparatorRegExp = /,\s*/; -var separators = [ - '(', ')', '<', '>', '@', - ',', ';', ':', '\\', '\"', - '/', '[', ']', '?', '=', - '{', '}', ' ', String.fromCharCode(9) -]; -var controlChars = [String.fromCharCode(127) /* DEL */]; -for (var i=0; i < 31; i ++) { - /* US-ASCII Control Characters */ - controlChars.push(String.fromCharCode(i)); -} - -var cookieNameValidateRegEx = /([\x00-\x20\x22\x28\x29\x2c\x2f\x3a-\x3f\x40\x5b-\x5e\x7b\x7d\x7f])/; -var cookieValueValidateRegEx = /[^\x21\x23-\x2b\x2d-\x3a\x3c-\x5b\x5d-\x7e]/; -var cookieValueDQuoteValidateRegEx = /^"[^"]*"$/; -var controlCharsAndSemicolonRegEx = /[\x00-\x20\x3b]/g; - -var cookieSeparatorRegEx = /[;,] */; - -var httpStatusDescriptions = { - 100: 'Continue', - 101: 'Switching Protocols', - 200: 'OK', - 201: 'Created', - 203: 'Non-Authoritative Information', - 204: 'No Content', - 205: 'Reset Content', - 206: 'Partial Content', - 300: 'Multiple Choices', - 301: 'Moved Permanently', - 302: 'Found', - 303: 'See Other', - 304: 'Not Modified', - 305: 'Use Proxy', - 307: 'Temporary Redirect', - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 406: 'Not Acceptable', - 407: 'Proxy Authorization Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Request Entity Too Long', - 414: 'Request-URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Requested Range Not Satisfiable', - 417: 'Expectation Failed', - 426: 'Upgrade Required', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported' -}; - -function WebSocketRequest(socket, httpRequest, serverConfig) { - // Superclass Constructor - EventEmitter.call(this); - - this.socket = socket; - this.httpRequest = httpRequest; - this.resource = httpRequest.url; - this.remoteAddress = socket.remoteAddress; - this.remoteAddresses = [this.remoteAddress]; - this.serverConfig = serverConfig; - - // Watch for the underlying TCP socket closing before we call accept - this._socketIsClosing = false; - this._socketCloseHandler = this._handleSocketCloseBeforeAccept.bind(this); - this.socket.on('end', this._socketCloseHandler); - this.socket.on('close', this._socketCloseHandler); - - this._resolved = false; -} - -util.inherits(WebSocketRequest, EventEmitter); - -WebSocketRequest.prototype.readHandshake = function() { - var self = this; - var request = this.httpRequest; - - // Decode URL - this.resourceURL = url.parse(this.resource, true); - - this.host = request.headers['host']; - if (!this.host) { - throw new Error('Client must provide a Host header.'); - } - - this.key = request.headers['sec-websocket-key']; - if (!this.key) { - throw new Error('Client must provide a value for Sec-WebSocket-Key.'); - } - - this.webSocketVersion = parseInt(request.headers['sec-websocket-version'], 10); - - if (!this.webSocketVersion || isNaN(this.webSocketVersion)) { - throw new Error('Client must provide a value for Sec-WebSocket-Version.'); - } - - switch (this.webSocketVersion) { - case 8: - case 13: - break; - default: - var e = new Error('Unsupported websocket client version: ' + this.webSocketVersion + - 'Only versions 8 and 13 are supported.'); - e.httpCode = 426; - e.headers = { - 'Sec-WebSocket-Version': '13' - }; - throw e; - } - - if (this.webSocketVersion === 13) { - this.origin = request.headers['origin']; - } - else if (this.webSocketVersion === 8) { - this.origin = request.headers['sec-websocket-origin']; - } - - // Protocol is optional. - var protocolString = request.headers['sec-websocket-protocol']; - this.protocolFullCaseMap = {}; - this.requestedProtocols = []; - if (protocolString) { - var requestedProtocolsFullCase = protocolString.split(headerValueSplitRegExp); - requestedProtocolsFullCase.forEach(function(protocol) { - var lcProtocol = protocol.toLocaleLowerCase(); - self.requestedProtocols.push(lcProtocol); - self.protocolFullCaseMap[lcProtocol] = protocol; - }); - } - - if (!this.serverConfig.ignoreXForwardedFor && - request.headers['x-forwarded-for']) { - var immediatePeerIP = this.remoteAddress; - this.remoteAddresses = request.headers['x-forwarded-for'] - .split(xForwardedForSeparatorRegExp); - this.remoteAddresses.push(immediatePeerIP); - this.remoteAddress = this.remoteAddresses[0]; - } - - // Extensions are optional. - var extensionsString = request.headers['sec-websocket-extensions']; - this.requestedExtensions = this.parseExtensions(extensionsString); - - // Cookies are optional - var cookieString = request.headers['cookie']; - this.cookies = this.parseCookies(cookieString); -}; - -WebSocketRequest.prototype.parseExtensions = function(extensionsString) { - if (!extensionsString || extensionsString.length === 0) { - return []; - } - var extensions = extensionsString.toLocaleLowerCase().split(headerValueSplitRegExp); - extensions.forEach(function(extension, index, array) { - var params = extension.split(headerParamSplitRegExp); - var extensionName = params[0]; - var extensionParams = params.slice(1); - extensionParams.forEach(function(rawParam, index, array) { - var arr = rawParam.split('='); - var obj = { - name: arr[0], - value: arr[1] - }; - array.splice(index, 1, obj); - }); - var obj = { - name: extensionName, - params: extensionParams - }; - array.splice(index, 1, obj); - }); - return extensions; -}; - -// This function adapted from node-cookie -// https://github.com/shtylman/node-cookie -WebSocketRequest.prototype.parseCookies = function(str) { - // Sanity Check - if (!str || typeof(str) !== 'string') { - return []; - } - - var cookies = []; - var pairs = str.split(cookieSeparatorRegEx); - - pairs.forEach(function(pair) { - var eq_idx = pair.indexOf('='); - if (eq_idx === -1) { - cookies.push({ - name: pair, - value: null - }); - return; - } - - var key = pair.substr(0, eq_idx).trim(); - var val = pair.substr(++eq_idx, pair.length).trim(); - - // quoted values - if ('"' === val[0]) { - val = val.slice(1, -1); - } - - cookies.push({ - name: key, - value: decodeURIComponent(val) - }); - }); - - return cookies; -}; - -WebSocketRequest.prototype.accept = function(acceptedProtocol, allowedOrigin, cookies) { - this._verifyResolution(); - - // TODO: Handle extensions - - var protocolFullCase; - - if (acceptedProtocol) { - protocolFullCase = this.protocolFullCaseMap[acceptedProtocol.toLocaleLowerCase()]; - if (typeof(protocolFullCase) === 'undefined') { - protocolFullCase = acceptedProtocol; - } - } - else { - protocolFullCase = acceptedProtocol; - } - this.protocolFullCaseMap = null; - - // Create key validation hash - var sha1 = crypto.createHash('sha1'); - sha1.update(this.key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); - var acceptKey = sha1.digest('base64'); - - var response = 'HTTP/1.1 101 Switching Protocols\r\n' + - 'Upgrade: websocket\r\n' + - 'Connection: Upgrade\r\n' + - 'Sec-WebSocket-Accept: ' + acceptKey + '\r\n'; - - if (protocolFullCase) { - // validate protocol - for (var i=0; i < protocolFullCase.length; i++) { - var charCode = protocolFullCase.charCodeAt(i); - var character = protocolFullCase.charAt(i); - if (charCode < 0x21 || charCode > 0x7E || separators.indexOf(character) !== -1) { - this.reject(500); - throw new Error('Illegal character "' + String.fromCharCode(character) + '" in subprotocol.'); - } - } - if (this.requestedProtocols.indexOf(acceptedProtocol) === -1) { - this.reject(500); - throw new Error('Specified protocol was not requested by the client.'); - } - - protocolFullCase = protocolFullCase.replace(headerSanitizeRegExp, ''); - response += 'Sec-WebSocket-Protocol: ' + protocolFullCase + '\r\n'; - } - this.requestedProtocols = null; - - if (allowedOrigin) { - allowedOrigin = allowedOrigin.replace(headerSanitizeRegExp, ''); - if (this.webSocketVersion === 13) { - response += 'Origin: ' + allowedOrigin + '\r\n'; - } - else if (this.webSocketVersion === 8) { - response += 'Sec-WebSocket-Origin: ' + allowedOrigin + '\r\n'; - } - } - - if (cookies) { - if (!Array.isArray(cookies)) { - this.reject(500); - throw new Error('Value supplied for "cookies" argument must be an array.'); - } - var seenCookies = {}; - cookies.forEach(function(cookie) { - if (!cookie.name || !cookie.value) { - this.reject(500); - throw new Error('Each cookie to set must at least provide a "name" and "value"'); - } - - // Make sure there are no \r\n sequences inserted - cookie.name = cookie.name.replace(controlCharsAndSemicolonRegEx, ''); - cookie.value = cookie.value.replace(controlCharsAndSemicolonRegEx, ''); - - if (seenCookies[cookie.name]) { - this.reject(500); - throw new Error('You may not specify the same cookie name twice.'); - } - seenCookies[cookie.name] = true; - - // token (RFC 2616, Section 2.2) - var invalidChar = cookie.name.match(cookieNameValidateRegEx); - if (invalidChar) { - this.reject(500); - throw new Error('Illegal character ' + invalidChar[0] + ' in cookie name'); - } - - // RFC 6265, Section 4.1.1 - // *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) | %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E - if (cookie.value.match(cookieValueDQuoteValidateRegEx)) { - invalidChar = cookie.value.slice(1, -1).match(cookieValueValidateRegEx); - } else { - invalidChar = cookie.value.match(cookieValueValidateRegEx); - } - if (invalidChar) { - this.reject(500); - throw new Error('Illegal character ' + invalidChar[0] + ' in cookie value'); - } - - var cookieParts = [cookie.name + '=' + cookie.value]; - - // RFC 6265, Section 4.1.1 - // 'Path=' path-value | - if(cookie.path){ - invalidChar = cookie.path.match(controlCharsAndSemicolonRegEx); - if (invalidChar) { - this.reject(500); - throw new Error('Illegal character ' + invalidChar[0] + ' in cookie path'); - } - cookieParts.push('Path=' + cookie.path); - } - - // RFC 6265, Section 4.1.2.3 - // 'Domain=' subdomain - if (cookie.domain) { - if (typeof(cookie.domain) !== 'string') { - this.reject(500); - throw new Error('Domain must be specified and must be a string.'); - } - invalidChar = cookie.domain.match(controlCharsAndSemicolonRegEx); - if (invalidChar) { - this.reject(500); - throw new Error('Illegal character ' + invalidChar[0] + ' in cookie domain'); - } - cookieParts.push('Domain=' + cookie.domain.toLowerCase()); - } - - // RFC 6265, Section 4.1.1 - //'Expires=' sane-cookie-date | Force Date object requirement by using only epoch - if (cookie.expires) { - if (!(cookie.expires instanceof Date)){ - this.reject(500); - throw new Error('Value supplied for cookie "expires" must be a vaild date object'); - } - cookieParts.push('Expires=' + cookie.expires.toGMTString()); - } - - // RFC 6265, Section 4.1.1 - //'Max-Age=' non-zero-digit *DIGIT - if (cookie.maxage) { - var maxage = cookie.maxage; - if (typeof(maxage) === 'string') { - maxage = parseInt(maxage, 10); - } - if (isNaN(maxage) || maxage <= 0 ) { - this.reject(500); - throw new Error('Value supplied for cookie "maxage" must be a non-zero number'); - } - maxage = Math.round(maxage); - cookieParts.push('Max-Age=' + maxage.toString(10)); - } - - // RFC 6265, Section 4.1.1 - //'Secure;' - if (cookie.secure) { - if (typeof(cookie.secure) !== 'boolean') { - this.reject(500); - throw new Error('Value supplied for cookie "secure" must be of type boolean'); - } - cookieParts.push('Secure'); - } - - // RFC 6265, Section 4.1.1 - //'HttpOnly;' - if (cookie.httponly) { - if (typeof(cookie.httponly) !== 'boolean') { - this.reject(500); - throw new Error('Value supplied for cookie "httponly" must be of type boolean'); - } - cookieParts.push('HttpOnly'); - } - - response += ('Set-Cookie: ' + cookieParts.join(';') + '\r\n'); - }.bind(this)); - } - - // TODO: handle negotiated extensions - // if (negotiatedExtensions) { - // response += 'Sec-WebSocket-Extensions: ' + negotiatedExtensions.join(', ') + '\r\n'; - // } - - // Mark the request resolved now so that the user can't call accept or - // reject a second time. - this._resolved = true; - this.emit('requestResolved', this); - - response += '\r\n'; - - var connection = new WebSocketConnection(this.socket, [], acceptedProtocol, false, this.serverConfig); - connection.webSocketVersion = this.webSocketVersion; - connection.remoteAddress = this.remoteAddress; - connection.remoteAddresses = this.remoteAddresses; - - var self = this; - - if (this._socketIsClosing) { - // Handle case when the client hangs up before we get a chance to - // accept the connection and send our side of the opening handshake. - cleanupFailedConnection(connection); - } - else { - this.socket.write(response, 'ascii', function(error) { - if (error) { - cleanupFailedConnection(connection); - return; - } - - self._removeSocketCloseListeners(); - connection._addSocketEventListeners(); - }); - } - - this.emit('requestAccepted', connection); - return connection; -}; - -WebSocketRequest.prototype.reject = function(status, reason, extraHeaders) { - this._verifyResolution(); - - // Mark the request resolved now so that the user can't call accept or - // reject a second time. - this._resolved = true; - this.emit('requestResolved', this); - - if (typeof(status) !== 'number') { - status = 403; - } - var response = 'HTTP/1.1 ' + status + ' ' + httpStatusDescriptions[status] + '\r\n' + - 'Connection: close\r\n'; - if (reason) { - reason = reason.replace(headerSanitizeRegExp, ''); - response += 'X-WebSocket-Reject-Reason: ' + reason + '\r\n'; - } - - if (extraHeaders) { - for (var key in extraHeaders) { - var sanitizedValue = extraHeaders[key].toString().replace(headerSanitizeRegExp, ''); - var sanitizedKey = key.replace(headerSanitizeRegExp, ''); - response += (sanitizedKey + ': ' + sanitizedValue + '\r\n'); - } - } - - response += '\r\n'; - this.socket.end(response, 'ascii'); - - this.emit('requestRejected', this); -}; - -WebSocketRequest.prototype._handleSocketCloseBeforeAccept = function() { - this._socketIsClosing = true; - this._removeSocketCloseListeners(); -}; - -WebSocketRequest.prototype._removeSocketCloseListeners = function() { - this.socket.removeListener('end', this._socketCloseHandler); - this.socket.removeListener('close', this._socketCloseHandler); -}; - -WebSocketRequest.prototype._verifyResolution = function() { - if (this._resolved) { - throw new Error('WebSocketRequest may only be accepted or rejected one time.'); - } -}; - -function cleanupFailedConnection(connection) { - // Since we have to return a connection object even if the socket is - // already dead in order not to break the API, we schedule a 'close' - // event on the connection object to occur immediately. - process.nextTick(function() { - // WebSocketConnection.CLOSE_REASON_ABNORMAL = 1006 - // Third param: Skip sending the close frame to a dead socket - connection.drop(1006, 'TCP connection lost before handshake completed.', true); - }); -} - -module.exports = WebSocketRequest; diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketRouter.js b/s4t-server-python/node_modules/websocket/lib/WebSocketRouter.js deleted file mode 100644 index 9d80a9a..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketRouter.js +++ /dev/null @@ -1,157 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var extend = require('./utils').extend; -var util = require('util'); -var EventEmitter = require('events').EventEmitter; -var WebSocketRouterRequest = require('./WebSocketRouterRequest'); - -function WebSocketRouter(config) { - // Superclass Constructor - EventEmitter.call(this); - - this.config = { - // The WebSocketServer instance to attach to. - server: null - }; - if (config) { - extend(this.config, config); - } - this.handlers = []; - - this._requestHandler = this.handleRequest.bind(this); - if (this.config.server) { - this.attachServer(this.config.server); - } -} - -util.inherits(WebSocketRouter, EventEmitter); - -WebSocketRouter.prototype.attachServer = function(server) { - if (server) { - this.server = server; - this.server.on('request', this._requestHandler); - } - else { - throw new Error('You must specify a WebSocketServer instance to attach to.'); - } -}; - -WebSocketRouter.prototype.detachServer = function() { - if (this.server) { - this.server.removeListener('request', this._requestHandler); - this.server = null; - } - else { - throw new Error('Cannot detach from server: not attached.'); - } -}; - -WebSocketRouter.prototype.mount = function(path, protocol, callback) { - if (!path) { - throw new Error('You must specify a path for this handler.'); - } - if (!protocol) { - protocol = '____no_protocol____'; - } - if (!callback) { - throw new Error('You must specify a callback for this handler.'); - } - - path = this.pathToRegExp(path); - if (!(path instanceof RegExp)) { - throw new Error('Path must be specified as either a string or a RegExp.'); - } - var pathString = path.toString(); - - // normalize protocol to lower-case - protocol = protocol.toLocaleLowerCase(); - - if (this.findHandlerIndex(pathString, protocol) !== -1) { - throw new Error('You may only mount one handler per path/protocol combination.'); - } - - this.handlers.push({ - 'path': path, - 'pathString': pathString, - 'protocol': protocol, - 'callback': callback - }); -}; -WebSocketRouter.prototype.unmount = function(path, protocol) { - var index = this.findHandlerIndex(this.pathToRegExp(path).toString(), protocol); - if (index !== -1) { - this.handlers.splice(index, 1); - } - else { - throw new Error('Unable to find a route matching the specified path and protocol.'); - } -}; - -WebSocketRouter.prototype.findHandlerIndex = function(pathString, protocol) { - protocol = protocol.toLocaleLowerCase(); - for (var i=0, len=this.handlers.length; i < len; i++) { - var handler = this.handlers[i]; - if (handler.pathString === pathString && handler.protocol === protocol) { - return i; - } - } - return -1; -}; - -WebSocketRouter.prototype.pathToRegExp = function(path) { - if (typeof(path) === 'string') { - if (path === '*') { - path = /^.*$/; - } - else { - path = path.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); - path = new RegExp('^' + path + '$'); - } - } - return path; -}; - -WebSocketRouter.prototype.handleRequest = function(request) { - var requestedProtocols = request.requestedProtocols; - if (requestedProtocols.length === 0) { - requestedProtocols = ['____no_protocol____']; - } - - // Find a handler with the first requested protocol first - for (var i=0; i < requestedProtocols.length; i++) { - var requestedProtocol = requestedProtocols[i].toLocaleLowerCase(); - - // find the first handler that can process this request - for (var j=0, len=this.handlers.length; j < len; j++) { - var handler = this.handlers[j]; - if (handler.path.test(request.resourceURL.pathname)) { - if (requestedProtocol === handler.protocol || - handler.protocol === '*') - { - var routerRequest = new WebSocketRouterRequest(request, requestedProtocol); - handler.callback(routerRequest); - return; - } - } - } - } - - // If we get here we were unable to find a suitable handler. - request.reject(404, 'No handler is available for the given request.'); -}; - -module.exports = WebSocketRouter; diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketRouterRequest.js b/s4t-server-python/node_modules/websocket/lib/WebSocketRouterRequest.js deleted file mode 100644 index 7f5c9e4..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketRouterRequest.js +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var util = require('util'); -var EventEmitter = require('events').EventEmitter; - -function WebSocketRouterRequest(webSocketRequest, resolvedProtocol) { - // Superclass Constructor - EventEmitter.call(this); - - this.webSocketRequest = webSocketRequest; - if (resolvedProtocol === '____no_protocol____') { - this.protocol = null; - } - else { - this.protocol = resolvedProtocol; - } - this.origin = webSocketRequest.origin; - this.resource = webSocketRequest.resource; - this.resourceURL = webSocketRequest.resourceURL; - this.httpRequest = webSocketRequest.httpRequest; - this.remoteAddress = webSocketRequest.remoteAddress; - this.webSocketVersion = webSocketRequest.webSocketVersion; - this.requestedExtensions = webSocketRequest.requestedExtensions; - this.cookies = webSocketRequest.cookies; -} - -util.inherits(WebSocketRouterRequest, EventEmitter); - -WebSocketRouterRequest.prototype.accept = function(origin, cookies) { - var connection = this.webSocketRequest.accept(this.protocol, origin, cookies); - this.emit('requestAccepted', connection); - return connection; -}; - -WebSocketRouterRequest.prototype.reject = function(status, reason, extraHeaders) { - this.webSocketRequest.reject(status, reason, extraHeaders); - this.emit('requestRejected', this); -}; - -module.exports = WebSocketRouterRequest; diff --git a/s4t-server-python/node_modules/websocket/lib/WebSocketServer.js b/s4t-server-python/node_modules/websocket/lib/WebSocketServer.js deleted file mode 100644 index 62b1cc2..0000000 --- a/s4t-server-python/node_modules/websocket/lib/WebSocketServer.js +++ /dev/null @@ -1,245 +0,0 @@ -/************************************************************************ - * Copyright 2010-2011 Worlize Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***********************************************************************/ - -var extend = require('./utils').extend; -var utils = require('./utils'); -var util = require('util'); -var debug = require('debug')('websocket:server'); -var EventEmitter = require('events').EventEmitter; -var WebSocketRequest = require('./WebSocketRequest'); - -var WebSocketServer = function WebSocketServer(config) { - // Superclass Constructor - EventEmitter.call(this); - - this._handlers = { - upgrade: this.handleUpgrade.bind(this), - requestAccepted: this.handleRequestAccepted.bind(this), - requestResolved: this.handleRequestResolved.bind(this) - }; - this.connections = []; - this.pendingRequests = []; - if (config) { - this.mount(config); - } -}; - -util.inherits(WebSocketServer, EventEmitter); - -WebSocketServer.prototype.mount = function(config) { - this.config = { - // The http server instance to attach to. Required. - httpServer: null, - - // 64KiB max frame size. - maxReceivedFrameSize: 0x10000, - - // 1MiB max message size, only applicable if - // assembleFragments is true - maxReceivedMessageSize: 0x100000, - - // Outgoing messages larger than fragmentationThreshold will be - // split into multiple fragments. - fragmentOutgoingMessages: true, - - // Outgoing frames are fragmented if they exceed this threshold. - // Default is 16KiB - fragmentationThreshold: 0x4000, - - // If true, the server will automatically send a ping to all - // clients every 'keepaliveInterval' milliseconds. The timer is - // reset on any received data from the client. - keepalive: true, - - // The interval to send keepalive pings to connected clients if the - // connection is idle. Any received data will reset the counter. - keepaliveInterval: 20000, - - // If true, the server will consider any connection that has not - // received any data within the amount of time specified by - // 'keepaliveGracePeriod' after a keepalive ping has been sent to - // be dead, and will drop the connection. - // Ignored if keepalive is false. - dropConnectionOnKeepaliveTimeout: true, - - // The amount of time to wait after sending a keepalive ping before - // closing the connection if the connected peer does not respond. - // Ignored if keepalive is false. - keepaliveGracePeriod: 10000, - - // Whether to use native TCP keep-alive instead of WebSockets ping - // and pong packets. Native TCP keep-alive sends smaller packets - // on the wire and so uses bandwidth more efficiently. This may - // be more important when talking to mobile devices. - // If this value is set to true, then these values will be ignored: - // keepaliveGracePeriod - // dropConnectionOnKeepaliveTimeout - useNativeKeepalive: false, - - // If true, fragmented messages will be automatically assembled - // and the full message will be emitted via a 'message' event. - // If false, each frame will be emitted via a 'frame' event and - // the application will be responsible for aggregating multiple - // fragmented frames. Single-frame messages will emit a 'message' - // event in addition to the 'frame' event. - // Most users will want to leave this set to 'true' - assembleFragments: true, - - // If this is true, websocket connections will be accepted - // regardless of the path and protocol specified by the client. - // The protocol accepted will be the first that was requested - // by the client. Clients from any origin will be accepted. - // This should only be used in the simplest of cases. You should - // probably leave this set to 'false' and inspect the request - // object to make sure it's acceptable before accepting it. - autoAcceptConnections: false, - - // Whether or not the X-Forwarded-For header should be respected. - // It's important to set this to 'true' when accepting connections - // from untrusted clients, as a malicious client could spoof its - // IP address by simply setting this header. It's meant to be added - // by a trusted proxy or other intermediary within your own - // infrastructure. - // See: http://en.wikipedia.org/wiki/X-Forwarded-For - ignoreXForwardedFor: false, - - // The Nagle Algorithm makes more efficient use of network resources - // by introducing a small delay before sending small packets so that - // multiple messages can be batched together before going onto the - // wire. This however comes at the cost of latency, so the default - // is to disable it. If you don't need low latency and are streaming - // lots of small messages, you can change this to 'false' - disableNagleAlgorithm: true, - - // The number of milliseconds to wait after sending a close frame - // for an acknowledgement to come back before giving up and just - // closing the socket. - closeTimeout: 5000 - }; - extend(this.config, config); - - if (this.config.httpServer) { - if (!Array.isArray(this.config.httpServer)) { - this.config.httpServer = [this.config.httpServer]; - } - var upgradeHandler = this._handlers.upgrade; - this.config.httpServer.forEach(function(httpServer) { - httpServer.on('upgrade', upgradeHandler); - }); - } - else { - throw new Error('You must specify an httpServer on which to mount the WebSocket server.'); - } -}; - -WebSocketServer.prototype.unmount = function() { - var upgradeHandler = this._handlers.upgrade; - this.config.httpServer.forEach(function(httpServer) { - httpServer.removeListener('upgrade', upgradeHandler); - }); -}; - -WebSocketServer.prototype.closeAllConnections = function() { - this.connections.forEach(function(connection) { - connection.close(); - }); - this.pendingRequests.forEach(function(request) { - process.nextTick(function() { - request.reject(503); // HTTP 503 Service Unavailable - }); - }); -}; - -WebSocketServer.prototype.broadcast = function(data) { - if (Buffer.isBuffer(data)) { - this.broadcastBytes(data); - } - else if (typeof(data.toString) === 'function') { - this.broadcastUTF(data); - } -}; - -WebSocketServer.prototype.broadcastUTF = function(utfData) { - this.connections.forEach(function(connection) { - connection.sendUTF(utfData); - }); -}; - -WebSocketServer.prototype.broadcastBytes = function(binaryData) { - this.connections.forEach(function(connection) { - connection.sendBytes(binaryData); - }); -}; - -WebSocketServer.prototype.shutDown = function() { - this.unmount(); - this.closeAllConnections(); -}; - -WebSocketServer.prototype.handleUpgrade = function(request, socket) { - var wsRequest = new WebSocketRequest(socket, request, this.config); - try { - wsRequest.readHandshake(); - } - catch(e) { - wsRequest.reject( - e.httpCode ? e.httpCode : 400, - e.message, - e.headers - ); - debug('Invalid handshake: %s', e.message); - return; - } - - this.pendingRequests.push(wsRequest); - - wsRequest.once('requestAccepted', this._handlers.requestAccepted); - wsRequest.once('requestResolved', this._handlers.requestResolved); - - if (!this.config.autoAcceptConnections && utils.eventEmitterListenerCount(this, 'request') > 0) { - this.emit('request', wsRequest); - } - else if (this.config.autoAcceptConnections) { - wsRequest.accept(wsRequest.requestedProtocols[0], wsRequest.origin); - } - else { - wsRequest.reject(404, 'No handler is configured to accept the connection.'); - } -}; - -WebSocketServer.prototype.handleRequestAccepted = function(connection) { - var self = this; - connection.once('close', function(closeReason, description) { - self.handleConnectionClose(connection, closeReason, description); - }); - this.connections.push(connection); - this.emit('connect', connection); -}; - -WebSocketServer.prototype.handleConnectionClose = function(connection, closeReason, description) { - var index = this.connections.indexOf(connection); - if (index !== -1) { - this.connections.splice(index, 1); - } - this.emit('close', connection, closeReason, description); -}; - -WebSocketServer.prototype.handleRequestResolved = function(request) { - var index = this.pendingRequests.indexOf(request); - if (index !== -1) { this.pendingRequests.splice(index, 1); } -}; - -module.exports = WebSocketServer; diff --git a/s4t-server-python/node_modules/websocket/lib/browser.js b/s4t-server-python/node_modules/websocket/lib/browser.js deleted file mode 100644 index 7dce5a9..0000000 --- a/s4t-server-python/node_modules/websocket/lib/browser.js +++ /dev/null @@ -1,35 +0,0 @@ -var _global = (function() { return this; })(); -var nativeWebSocket = _global.WebSocket || _global.MozWebSocket; - - -/** - * Expose a W3C WebSocket class with just one or two arguments. - */ -function W3CWebSocket(uri, protocols) { - var native_instance; - - if (protocols) { - native_instance = new nativeWebSocket(uri, protocols); - } - else { - native_instance = new nativeWebSocket(uri); - } - - /** - * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket - * class). Since it is an Object it will be returned as it is when creating an - * instance of W3CWebSocket via 'new W3CWebSocket()'. - * - * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2 - */ - return native_instance; -} - - -/** - * Module exports. - */ -module.exports = { - 'w3cwebsocket' : nativeWebSocket ? W3CWebSocket : null, - 'version' : require('./version') -}; diff --git a/s4t-server-python/node_modules/websocket/lib/utils.js b/s4t-server-python/node_modules/websocket/lib/utils.js deleted file mode 100644 index 6506dc9..0000000 --- a/s4t-server-python/node_modules/websocket/lib/utils.js +++ /dev/null @@ -1,60 +0,0 @@ -var noop = exports.noop = function(){}; - -exports.extend = function extend(dest, source) { - for (var prop in source) { - dest[prop] = source[prop]; - } -}; - -exports.eventEmitterListenerCount = - require('events').EventEmitter.listenerCount || - function(emitter, type) { return emitter.listeners(type).length; }; - - - - - -exports.BufferingLogger = function createBufferingLogger(identifier, uniqueID) { - var logFunction = require('debug')(identifier); - if (logFunction.enabled) { - var logger = new BufferingLogger(identifier, uniqueID, logFunction); - var debug = logger.log.bind(logger); - debug.printOutput = logger.printOutput.bind(logger); - debug.enabled = logFunction.enabled; - return debug; - } - logFunction.printOutput = noop; - return logFunction; -}; - -function BufferingLogger(identifier, uniqueID, logFunction) { - this.logFunction = logFunction; - this.identifier = identifier; - this.uniqueID = uniqueID; - this.buffer = []; -} - -BufferingLogger.prototype.log = function() { - this.buffer.push([ new Date(), Array.prototype.slice.call(arguments) ]); - return this; -}; - -BufferingLogger.prototype.clear = function() { - this.buffer = []; - return this; -}; - -BufferingLogger.prototype.printOutput = function(logFunction) { - if (!logFunction) { logFunction = this.logFunction; } - var uniqueID = this.uniqueID; - this.buffer.forEach(function(entry) { - var date = entry[0].toLocaleString(); - var args = entry[1].slice(); - var formatString = args[0]; - if (formatString !== (void 0) && formatString !== null) { - formatString = '%s - %s - ' + formatString.toString(); - args.splice(0, 1, formatString, date, uniqueID); - logFunction.apply(global, args); - } - }); -}; diff --git a/s4t-server-python/node_modules/websocket/lib/version.js b/s4t-server-python/node_modules/websocket/lib/version.js deleted file mode 100644 index 81f6e78..0000000 --- a/s4t-server-python/node_modules/websocket/lib/version.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../package.json').version; diff --git a/s4t-server-python/node_modules/websocket/lib/websocket.js b/s4t-server-python/node_modules/websocket/lib/websocket.js deleted file mode 100644 index 6242d56..0000000 --- a/s4t-server-python/node_modules/websocket/lib/websocket.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - 'server' : require('./WebSocketServer'), - 'client' : require('./WebSocketClient'), - 'router' : require('./WebSocketRouter'), - 'frame' : require('./WebSocketFrame'), - 'request' : require('./WebSocketRequest'), - 'connection' : require('./WebSocketConnection'), - 'w3cwebsocket' : require('./W3CWebSocket'), - 'deprecation' : require('./Deprecation'), - 'version' : require('./version') -}; diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/.jshintrc b/s4t-server-python/node_modules/websocket/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/.npmignore b/s4t-server-python/node_modules/websocket/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163d..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/History.md b/s4t-server-python/node_modules/websocket/node_modules/debug/History.md deleted file mode 100644 index 2c40404..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/History.md +++ /dev/null @@ -1,166 +0,0 @@ - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/Makefile b/s4t-server-python/node_modules/websocket/node_modules/debug/Makefile deleted file mode 100644 index b0bde6e..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/Makefile +++ /dev/null @@ -1,33 +0,0 @@ - -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# applications -NODE ?= $(shell which node) -NPM ?= $(NODE) $(shell which npm) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -all: dist/debug.js - -install: node_modules - -clean: - @rm -rf node_modules dist - -dist: - @mkdir -p $@ - -dist/debug.js: node_modules browser.js debug.js dist - @$(BROWSERIFY) \ - --standalone debug \ - . > $@ - -node_modules: package.json - @NODE_ENV= $(NPM) install - @touch node_modules - -.PHONY: all install clean diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/Readme.md b/s4t-server-python/node_modules/websocket/node_modules/debug/Readme.md deleted file mode 100644 index e6a02d9..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/Readme.md +++ /dev/null @@ -1,166 +0,0 @@ -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - -Then, run the program to be debugged as ususal. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - -### stderr vs stdout - -You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: - -Example _stderr.js_: - -```js -var debug = require('../'); -var log = debug('app:log'); - -// by default console.log is used -log('goes to stdout!'); - -var error = debug('app:error'); -// set this namespace to log via console.error -error.log = console.error.bind(console); // don't forget to bind to console! -error('goes to stderr'); -log('still goes to stdout!'); - -// set all output to go via console.warn -// overrides all per-namespace log settings -debug.log = console.warn.bind(console); -log('now goes to stderr via console.warn'); -error('still goes to stderr, but via console.warn now'); -``` - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - -## License - -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/bower.json b/s4t-server-python/node_modules/websocket/node_modules/debug/bower.json deleted file mode 100644 index c4fabd4..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia/debug", - "main": "dist/debug.js", - "version": "2.1.1", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia/debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/browser.js b/s4t-server-python/node_modules/websocket/node_modules/debug/browser.js deleted file mode 100644 index 52c3d32..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/browser.js +++ /dev/null @@ -1,158 +0,0 @@ - -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Use chrome.storage.local if we are in an app - */ - -var storage; - -if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') - storage = chrome.storage.local; -else - storage = window.localStorage; - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // is webkit? http://stackoverflow.com/a/16459606/376773 - return ('WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - return JSON.stringify(v); -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return args; - - var c = 'color: ' + this.color; - args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); - return args; -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - storage.removeItem('debug'); - } else { - storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = storage.debug; - } catch(e) {} - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/component.json b/s4t-server-python/node_modules/websocket/node_modules/debug/component.json deleted file mode 100644 index 71e1abb..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.1.1", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "guille/ms.js": "0.6.1" - } -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/debug.js b/s4t-server-python/node_modules/websocket/node_modules/debug/debug.js deleted file mode 100644 index 7571a86..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/debug.js +++ /dev/null @@ -1,197 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = debug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lowercased letter, i.e. "n". - */ - -exports.formatters = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function selectColor() { - return exports.colors[prevColor++ % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function debug(namespace) { - - // define the `disabled` version - function disabled() { - } - disabled.enabled = false; - - // define the `enabled` version - function enabled() { - - var self = enabled; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // add the `color` if not set - if (null == self.useColors) self.useColors = exports.useColors(); - if (null == self.color && self.useColors) self.color = selectColor(); - - var args = Array.prototype.slice.call(arguments); - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %o - args = ['%o'].concat(args); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - if ('function' === typeof exports.formatArgs) { - args = exports.formatArgs.apply(self, args); - } - var logFn = enabled.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - enabled.enabled = true; - - var fn = exports.enabled(namespace) ? enabled : disabled; - - fn.namespace = namespace; - - return fn; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/node.js b/s4t-server-python/node_modules/websocket/node_modules/debug/node.js deleted file mode 100644 index 5dc999f..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/node.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); - if (0 === debugColors.length) { - return tty.isatty(fd); - } else { - return '0' !== debugColors - && 'no' !== debugColors - && 'false' !== debugColors - && 'disabled' !== debugColors; - } -} - -/** - * Map %o to `util.inspect()`, since Node doesn't do that out of the box. - */ - -var inspect = (4 === util.inspect.length ? - // node <= 0.8.x - function (v, colors) { - return util.inspect(v, void 0, void 0, colors); - } : - // node > 0.8.x - function (v, colors) { - return util.inspect(v, { colors: colors }); - } -); - -exports.formatters.o = function(v) { - return inspect(v, this.useColors) - .replace(/\s*\n\s*/g, ' '); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs() { - var args = arguments; - var useColors = this.useColors; - var name = this.namespace; - - if (useColors) { - var c = this.color; - - args[0] = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[0m' - + args[0] + '\u001b[3' + c + 'm' - + ' +' + exports.humanize(this.diff) + '\u001b[0m'; - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } - return args; -} - -/** - * Invokes `console.error()` with the specified arguments. - */ - -function log() { - return stream.write(util.format.apply(this, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/.npmignore b/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/README.md b/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/README.md deleted file mode 100644 index d4ab12a..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# ms.js: miliseconds conversion utility - -```js -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('100') // 100 -``` - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours', { long: true })) // "10 hours" -``` - -- Node/Browser compatible. Published as `ms` in NPM. -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as -a number (e.g: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of -equivalent ms is returned. - -## License - -MIT \ No newline at end of file diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/index.js b/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/index.js deleted file mode 100644 index c5847f8..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/index.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 's': - return n * s; - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/package.json b/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index 8334411..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "ms", - "version": "0.6.2", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "bugs": { - "url": "https://github.com/guille/ms.js/issues" - }, - "_id": "ms@0.6.2", - "dist": { - "shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.6.2.tgz" - }, - "_from": "ms@0.6.2", - "_npmVersion": "1.2.30", - "_npmUser": { - "name": "rauchg", - "email": "rauchg@gmail.com" - }, - "maintainers": [ - { - "name": "rauchg", - "email": "rauchg@gmail.com" - } - ], - "directories": {}, - "_shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/debug/package.json b/s4t-server-python/node_modules/websocket/node_modules/debug/package.json deleted file mode 100644 index 58f6ce2..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/debug/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "debug", - "version": "2.1.1", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - } - ], - "license": "MIT", - "dependencies": { - "ms": "0.6.2" - }, - "devDependencies": { - "browserify": "6.1.0", - "mocha": "*" - }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - }, - "gitHead": "24cc5c04fc8886fa9afcadea4db439f9a6186ca4", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.1.1", - "scripts": {}, - "_shasum": "e0c548cc607adc22b537540dc3639c4236fdf90c", - "_from": "debug@>=2.1.0 <2.2.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "e0c548cc607adc22b537540dc3639c4236fdf90c", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/.dntrc b/s4t-server-python/node_modules/websocket/node_modules/nan/.dntrc deleted file mode 100644 index 1c3e624..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/.dntrc +++ /dev/null @@ -1,36 +0,0 @@ -## DNT config file -## see https://github.com/rvagg/dnt - -NODE_VERSIONS="\ - master \ - v0.11.13 \ - v0.11.10 \ - v0.11.9 \ - v0.11.8 \ - v0.11.7 \ - v0.11.6 \ - v0.11.5 \ - v0.11.4 \ - v0.10.26 \ - v0.10.25 \ - v0.10.24 \ - v0.10.23 \ - v0.10.22 \ - v0.10.21 \ - v0.10.20 \ - v0.10.19 \ - v0.10.18 \ - v0.8.26 \ - v0.8.25 \ - v0.8.24 \ - v0.8.23 \ - v0.8.22 \ -" -OUTPUT_PREFIX="nan-" -TEST_CMD="\ - cd /dnt/test/ && \ - npm install && \ - node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild && \ - node_modules/.bin/tap --gc js/*-test.js; \ -" - diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/LICENSE b/s4t-server-python/node_modules/websocket/node_modules/nan/LICENSE deleted file mode 100644 index d502e18..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright 2013, NAN contributors: - - Rod Vagg - - Benjamin Byholm - - Trevor Norris - - Nathan Rajlich - - Brett Lawson - - Ben Noordhuis -(the "Original Author") -All rights reserved. - -MIT +no-false-attribs License - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/README.md b/s4t-server-python/node_modules/websocket/node_modules/nan/README.md deleted file mode 100644 index 7c8d688..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/README.md +++ /dev/null @@ -1,947 +0,0 @@ -Native Abstractions for Node.js -=============================== - -**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.** - -***Current version: 1.0.0*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)* - -[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/) - -Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. - -This project also contains some helper utilities that make addon development a bit more pleasant. - - * **[News & Updates](#news)** - * **[Usage](#usage)** - * **[Example](#example)** - * **[API](#api)** - - -## News & Updates - -### May-2013: Major changes for V8 3.25 / Node 0.11.13 - -Node 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes. - -Because we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API. - -We have **removed support for Node 0.11 versions prior to 0.11.13**, (although our tests are still passing for 0.11.10). As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously. - -The major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`. - -We also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this. - -V8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality. - -`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead. - -Because `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallabck()`. You should *always* use this when calling a JavaScript function from C++. - -There's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details. - -### Dec-2013: NanCString and NanRawString - -Two new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments. - -### Nov-2013: Node 0.11.9+ breaking V8 change - -The version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases). - -For example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`. - -### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN - -Inclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `" -## Usage - -Simply add **NAN** as a dependency in the *package.json* of your Node addon: - -``` bash -$ npm install --save nan -``` - -Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: - -``` python -"include_dirs" : [ - "` when compiling your addon. - - -## Example - -See **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use. - -For a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. - -Compare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work). - -Note that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class. - -```c++ -// addon.cc -#include -#include -// ... - -using v8::FunctionTemplate; -using v8::Handle; -using v8::Object; - -void InitAll(Handle exports) { - exports->Set(NanSymbol("calculateSync"), - NanNew(CalculateSync)->GetFunction()); - - exports->Set(NanSymbol("calculateAsync"), - NanNew(CalculateAsync)->GetFunction()); -} - -NODE_MODULE(addon, InitAll) -``` - -```c++ -// sync.h -#include -#include - -NAN_METHOD(CalculateSync); -``` - -```c++ -// sync.cc -#include -#include -#include "./sync.h" -// ... - -using v8::Number; - -// Simple synchronous access to the `Estimate()` function -NAN_METHOD(CalculateSync) { - NanScope(); - - // expect a number as the first argument - int points = args[0]->Uint32Value(); - double est = Estimate(points); - - NanReturnValue(NanNew(est)); -} -``` - -```c++ -// async.cc -#include -#include -#include "./async.h" - -// ... - -using v8::Function; -using v8::Local; -using v8::Null; -using v8::Number; -using v8::Value; - -class PiWorker : public NanAsyncWorker { - public: - PiWorker(NanCallback *callback, int points) - : NanAsyncWorker(callback), points(points) {} - ~PiWorker() {} - - // Executed inside the worker-thread. - // It is not safe to access V8, or V8 data structures - // here, so everything we need for input and output - // should go on `this`. - void Execute () { - estimate = Estimate(points); - } - - // Executed when the async work is complete - // this function will be run inside the main event loop - // so it is safe to use V8 again - void HandleOKCallback () { - NanScope(); - - Local argv[] = { - NanNew(NanNull()) - , NanNew(estimate) - }; - - callback->Call(2, argv); - }; - - private: - int points; - double estimate; -}; - -// Asynchronous access to the `Estimate()` function -NAN_METHOD(CalculateAsync) { - NanScope(); - - int points = args[0]->Uint32Value(); - NanCallback *callback = new NanCallback(args[1].As()); - - NanAsyncQueueWorker(new PiWorker(callback, points)); - NanReturnUndefined(); -} -``` - - -## API - - * NAN_METHOD - * NAN_GETTER - * NAN_SETTER - * NAN_PROPERTY_GETTER - * NAN_PROPERTY_SETTER - * NAN_PROPERTY_ENUMERATOR - * NAN_PROPERTY_DELETER - * NAN_PROPERTY_QUERY - * NAN_INDEX_GETTER - * NAN_INDEX_SETTER - * NAN_INDEX_ENUMERATOR - * NAN_INDEX_DELETER - * NAN_INDEX_QUERY - * NAN_WEAK_CALLBACK - * NAN_DEPRECATED - * NAN_INLINE - * NanNew - * NanUndefined - * NanNull - * NanTrue - * NanFalse - * NanReturnValue - * NanReturnUndefined - * NanReturnNull - * NanReturnEmptyString - * NanScope - * NanEscapableScope - * NanEscapeScope - * NanLocker - * NanUnlocker - * NanGetInternalFieldPointer - * NanSetInternalFieldPointer - * NanObjectWrapHandle - * NanSymbol - * NanGetPointerSafe - * NanSetPointerSafe - * NanRawString - * NanCString - * NanBooleanOptionValue - * NanUInt32OptionValue - * NanError, NanTypeError, NanRangeError - * NanThrowError, NanThrowTypeError, NanThrowRangeError, NanThrowError(Handle), NanThrowError(Handle, int) - * NanNewBufferHandle(char *, size_t, FreeCallback, void *), NanNewBufferHandle(char *, uint32_t), NanNewBufferHandle(uint32_t) - * NanBufferUse(char *, uint32_t) - * NanNewContextHandle - * NanGetCurrentContext - * NanHasInstance - * NanDisposePersistent - * NanAssignPersistent - * NanMakeWeakPersistent - * NanSetTemplate - * NanMakeCallback - * NanCompileScript - * NanRunScript - * NanAdjustExternalMemory - * NanAddGCEpilogueCallback - * NanAddGCPrologueCallback - * NanRemoveGCEpilogueCallback - * NanRemoveGCPrologueCallback - * NanGetHeapStatistics - * NanCallback - * NanAsyncWorker - * NanAsyncQueueWorker - - -### NAN_METHOD(methodname) - -Use `NAN_METHOD` to define your V8 accessible methods: - -```c++ -// .h: -class Foo : public node::ObjectWrap { - ... - - static NAN_METHOD(Bar); - static NAN_METHOD(Baz); -} - - -// .cc: -NAN_METHOD(Foo::Bar) { - ... -} - -NAN_METHOD(Foo::Baz) { - ... -} -``` - -The reason for this macro is because of the method signature change in 0.11: - -```c++ -// 0.10 and below: -Handle name(const Arguments& args) - -// 0.11 and above -void name(const FunctionCallbackInfo& args) -``` - -The introduction of `FunctionCallbackInfo` brings additional complications: - - -### NAN_GETTER(methodname) - -Use `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`. - - -### NAN_SETTER(methodname) - -Use `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_GETTER(cbname) -Use `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`. - - -### NAN_PROPERTY_SETTER(cbname) -Use `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_ENUMERATOR(cbname) -Use `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`. - - -### NAN_PROPERTY_DELETER(cbname) -Use `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`. - - -### NAN_PROPERTY_QUERY(cbname) -Use `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`. - - -### NAN_INDEX_GETTER(cbname) -Use `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`. - - -### NAN_INDEX_SETTER(cbname) -Use `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_INDEX_ENUMERATOR(cbname) -Use `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`. - - -### NAN_INDEX_DELETER(cbname) -Use `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`. - - -### NAN_INDEX_QUERY(cbname) -Use `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`. - - -### NAN_WEAK_CALLBACK(cbname) - -Use `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. Do not use for declaration. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - int *parameter = data.GetParameter(); - NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL); - if ((*parameter)++ == 0) { - data.Revive(); - } else { - delete parameter; - data.Dispose(); - } -} -``` - - -### NAN_DEPRECATED -Declares a function as deprecated. - -```c++ -static NAN_DEPRECATED NAN_METHOD(foo) { - ... -} -``` - - -### NAN_INLINE -Inlines a function. - -```c++ -NAN_INLINE int foo(int bar) { - ... -} -``` - - -### Local<T> NanNew<T>( ... ) - -Use `NanNew` to construct almost all v8 objects and make new local handles. - -```c++ -Local s = NanNew("value"); - -... - -Persistent o; - -... - -Local lo = NanNew(o); - -``` - - -### Handle<Primitive> NanUndefined() - -Use instead of `Undefined()` - - -### Handle<Primitive> NanNull() - -Use instead of `Null()` - - -### Handle<Primitive> NanTrue() - -Use instead of `True()` - - -### Handle<Primitive> NanFalse() - -Use instead of `False()` - - -### NanReturnValue(Handle<Value>) - -Use `NanReturnValue` when you want to return a value from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Bar) { - ... - - NanReturnValue(NanNew("FooBar!")); -} -``` - -No `return` statement required. - - -### NanReturnUndefined() - -Use `NanReturnUndefined` when you don't want to return anything from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnUndefined(); -} -``` - - -### NanReturnNull() - -Use `NanReturnNull` when you want to return `Null` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnNull(); -} -``` - - -### NanReturnEmptyString() - -Use `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnEmptyString(); -} -``` - - -### NanScope() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanScope(); - - NanReturnValue(NanNew("FooBar!")); -} -``` - - -### NanEscapableScope() - -The separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to `Close()` the scope: - -```c++ -Handle Foo::Bar() { - NanEscapableScope(); - - return NanEscapeScope(NanNew("FooBar!")); -} -``` - - -### Local<T> NanEscapeScope(Handle<T> value); -Use together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`. - - -### NanLocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### NanUnlocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### void * NanGetInternalFieldPointer(Handle<Object>, int) - -Gets a pointer to the internal field with at `index` from a V8 `Object` handle. - -```c++ -Local obj; -... -NanGetInternalFieldPointer(obj, 0); -``` - -### void NanSetInternalFieldPointer(Handle<Object>, int, void *) - -Sets the value of the internal field at `index` on a V8 `Object` handle. - -```c++ -static Persistent dataWrapperCtor; -... -Local wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance(); -NanSetInternalFieldPointer(wrapper, 0, this); -``` - - -### Local<Object> NanObjectWrapHandle(Object) - -When you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`: - -```c++ -NanObjectWrapHandle(iterator)->Get(NanSymbol("end")) -``` - - -### String NanSymbol(char *) - -Use to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects. - -```c++ -bool foo = false; -if (obj->Has(NanSymbol("foo"))) - foo = optionsObj->Get(NanSymbol("foo"))->BooleanValue() -``` - - -### Type NanGetPointerSafe(Type *[, Type]) - -A helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to. - -```c++ -char *plugh(uint32_t *optional) { - char res[] = "xyzzy"; - uint32_t param = NanGetPointerSafe(optional, 0x1337); - switch (param) { - ... - } - NanSetPointerSafe(optional, 0xDEADBEEF); -} -``` - - -### bool NanSetPointerSafe(Type *, Type) - -A helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to. - -```c++ -const char *plugh(size_t *outputsize) { - char res[] = "xyzzy"; - if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) { - ... - } - - ... -} -``` - - -### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int) - -When you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -void* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED); -char param_copy[count]; -memcpy(param_copy, decoded, count); -delete[] decoded; -``` - - -### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int]) - -When you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -char* name = NanCString(args[0], &count); -``` - - -### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool]) - -When you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`. - -The optional last parameter is the *default* value, which is `false` if left off: - -```c++ -// `foo` is false unless the user supplies a truthy value for it -bool foo = NanBooleanOptionValue(optionsObj, NanSymbol("foo")); -// `bar` is true unless the user supplies a falsy value for it -bool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol("bar"), true); -``` - - -### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t) - -Similar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer. - -Requires all 3 arguments as a default is not optional: - -```c++ -uint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol("count"), 1024); -``` - - -### NanError(message), NanTypeError(message), NanRangeError(message) - -For making `Error`, `TypeError` and `RangeError` objects. - -```c++ -Local res = NanError("you must supply a callback argument"); -``` - - -### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int) - -For throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call: - -```c++ -return NanThrowError("you must supply a callback argument"); -``` - -Can also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`. - - -### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t) - -The `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation: - -```c++ -NanNewBufferHandle((char*)value.data(), value.size()); -``` - -Can also be used to initialize a `Buffer` with just a `size` argument. - -Can also be supplied with a `NanFreeCallback` and a hint for the garbage collector. - - -### Local<Object> NanBufferUse(char*, uint32_t) - -`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data. -While it was possible to get around this, it required a shim by passing a -callback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove -needing to use this shim. - -`NanBufferUse` uses the `char*` passed as the backing data, and will free the -memory automatically when the weak callback is called. Keep this in mind, as -careless use can lead to "double free or corruption" and other cryptic failures. - - -### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>) - -Can be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for. - - -### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>]) -Creates a new `Local` handle. - -```c++ -Local ftmpl = NanNew(); -Local otmpl = ftmpl->InstanceTemplate(); -Local ctx = NanNewContextHandle(NULL, otmpl); -``` - - -### Local NanGetCurrentContext() - -Gets the current context. - -```c++ -Local ctx = NanGetCurrentContext(); -``` - - -### void NanDisposePersistent(Persistent<T> &) - -Use `NanDisposePersistent` to dispose a `Persistent` handle. - -```c++ -NanDisposePersistent(persistentHandle); -``` - - -### NanAssignPersistent(type, handle, object) - -Use `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier. - -In general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`: - -```c++ -Persistent persistentHandle; - -... - -Local obj = NanNew(); -obj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local -NanAssignPersistent(Object, persistentHandle, obj) -``` - - -### NanMakeWeakPersistent(Handle<T> handle, P* parameter, _NanWeakCallbackInfo<T, P>::Callback callback) - -Creates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. The callback has to be fully specialized to work on all versions of Node. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - -... - -} - -Local func; - -... - -int *parameter = new int(0); -NanMakeWeakPersistent(func, parameter, &weakCallback); -``` - - -### NanSetTemplate(templ, name, value) - -Use to add properties on object and function templates. - - -### NanMakeCallback(target, func, argc, argv) - -Use instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions. - - -### NanCompileScript(Handle s [, const ScriptOrigin& origin]) - -Use to create new scripts bound to the current context. - - -### NanRunScript(script) - -Use to run both bound and unbound scripts. - - -### NanAdjustExternalMemory(int change_in_bytes) - -Simply does `AdjustAmountOfExternalAllocatedMemory` - - -### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCEpilogueCallback` - - -### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCPrologueCallback` - - -### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback) - -Simply does `RemoveGCEpilogueCallback` - - -### NanRemoveGCPrologueCallback(GCPrologueCallback callback) - -Simply does `RemoveGCPrologueCallback` - - -### NanGetHeapStatistics(HeapStatistics *heap_statistics) - -Simply does `GetHeapStatistics` - - -### NanCallback - -Because of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`. - -```c++ -Local callbackHandle = args[0].As(); -NanCallback *callback = new NanCallback(callbackHandle); -// pass `callback` around and it's safe from GC until you: -delete callback; -``` - -You can execute the callback like so: - -```c++ -// no arguments: -callback->Call(0, NULL); - -// an error argument: -Handle argv[] = { - NanError(NanNew("fail!")) -}; -callback->Call(1, argv); - -// a success argument: -Handle argv[] = { - NanNull(), - NanNew("w00t!") -}; -callback->Call(2, argv); -``` - -`NanCallback` also has a `Local GetCallback()` method that you can use -to fetch a local handle to the underlying callback function, as well as a -`void SetFunction(Handle)` for setting the callback on the -`NanCallback`. Additionally a generic constructor is available for using -`NanCallback` without performing heap allocations. - - -### NanAsyncWorker - -`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress. - -See a rough outline of the implementation: - -```c++ -class NanAsyncWorker { -public: - NanAsyncWorker (NanCallback *callback); - - // Clean up persistent handles and delete the *callback - virtual ~NanAsyncWorker (); - - // Check the `char *errmsg` property and call HandleOKCallback() - // or HandleErrorCallback depending on whether it has been set or not - virtual void WorkComplete (); - - // You must implement this to do some async work. If there is an - // error then allocate `errmsg` to a message and the callback will - // be passed that string in an Error object - virtual void Execute (); - - // Save a V8 object in a Persistent handle to protect it from GC - void SavePersistent(const char *key, Local &obj); - - // Fetch a stored V8 object (don't call from within `Execute()`) - Local GetFromPersistent(const char *key); - -protected: - // Set this if there is an error, otherwise it's NULL - const char *errmsg; - - // Default implementation calls the callback function with no arguments. - // Override this to return meaningful data - virtual void HandleOKCallback (); - - // Default implementation calls the callback function with an Error object - // wrapping the `errmsg` string - virtual void HandleErrorCallback (); -}; -``` - - -### NanAsyncQueueWorker(NanAsyncWorker *) - -`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`. - -### Contributors - -NAN is only possible due to the excellent work of the following contributors: - - - - - - - - -
Rod VaggGitHub/rvaggTwitter/@rvagg
Benjamin ByholmGitHub/kkoopa
Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
Brett LawsonGitHub/brett19Twitter/@brett19x
Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
- -Licence & copyright ------------------------ - -Copyright (c) 2014 NAN contributors (listed above). - -Native Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/build/config.gypi b/s4t-server-python/node_modules/websocket/node_modules/nan/build/config.gypi deleted file mode 100644 index e085a50..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/build/config.gypi +++ /dev/null @@ -1,38 +0,0 @@ -# Do not edit. File was generated by node-gyp's "configure" step -{ - "target_defaults": { - "cflags": [], - "default_configuration": "Release", - "defines": [], - "include_dirs": [], - "libraries": [] - }, - "variables": { - "clang": 0, - "gcc_version": 47, - "host_arch": "x64", - "node_install_npm": "true", - "node_prefix": "", - "node_shared_cares": "false", - "node_shared_http_parser": "false", - "node_shared_libuv": "false", - "node_shared_openssl": "false", - "node_shared_v8": "false", - "node_shared_zlib": "false", - "node_tag": "", - "node_unsafe_optimizations": 0, - "node_use_dtrace": "false", - "node_use_etw": "false", - "node_use_openssl": "true", - "node_use_perfctr": "false", - "node_use_systemtap": "false", - "python": "/usr/bin/python", - "target_arch": "x64", - "v8_enable_gdbjit": 0, - "v8_no_strict_aliasing": 1, - "v8_use_snapshot": "true", - "nodedir": "/home/rvagg/.node-gyp/0.10.21", - "copy_dev_lib": "true", - "standalone_static_library": 1 - } -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/include_dirs.js b/s4t-server-python/node_modules/websocket/node_modules/nan/include_dirs.js deleted file mode 100644 index 4f1dfb4..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/include_dirs.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('path').relative('.', __dirname)); diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/nan.h b/s4t-server-python/node_modules/websocket/node_modules/nan/nan.h deleted file mode 100644 index bc544f5..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/nan.h +++ /dev/null @@ -1,1910 +0,0 @@ -/********************************************************************************** - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2014 NAN contributors: - * - Rod Vagg - * - Benjamin Byholm - * - Trevor Norris - * - Nathan Rajlich - * - Brett Lawson - * - Ben Noordhuis - * - * MIT +no-false-attribs License - * - * Version 1.0.0 (current Node unstable: 0.11.13, Node stable: 0.10.28) - * - * ChangeLog: - * * 1.0.0 May 4 2014 - * - Heavy API changes for V8 3.25 / Node 0.11.13 - * - Use cpplint.py - * - Removed NanInitPersistent - * - Removed NanPersistentToLocal - * - Removed NanFromV8String - * - Removed NanMakeWeak - * - Removed NanNewLocal - * - Removed NAN_WEAK_CALLBACK_OBJECT - * - Removed NAN_WEAK_CALLBACK_DATA - * - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions - * - Introduce NanUndefined, NanNull, NanTrue and NanFalse - * - Introduce NanEscapableScope and NanEscapeScope - * - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) - * - Introduce NanMakeCallback for node::MakeCallback - * - Introduce NanSetTemplate - * - Introduce NanGetCurrentContext - * - Introduce NanCompileScript and NanRunScript - * - Introduce NanAdjustExternalMemory - * - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback - * - Introduce NanGetHeapStatistics - * - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() - * - * * 0.8.0 Jan 9 2014 - * - NanDispose -> NanDisposePersistent, deprecate NanDispose - * - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() - * - * * 0.7.1 Jan 9 2014 - * - Fixes to work against debug builds of Node - * - Safer NanPersistentToLocal (avoid reinterpret_cast) - * - Speed up common NanRawString case by only extracting flattened string when necessary - * - * * 0.7.0 Dec 17 2013 - * - New no-arg form of NanCallback() constructor. - * - NanCallback#Call takes Handle rather than Local - * - Removed deprecated NanCallback#Run method, use NanCallback#Call instead - * - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS - * - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() - * - Introduce NanRawString() for char* (or appropriate void*) from v8::String - * (replacement for NanFromV8String) - * - Introduce NanCString() for null-terminated char* from v8::String - * - * * 0.6.0 Nov 21 2013 - * - Introduce NanNewLocal(v8::Handle value) for use in place of - * v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 - * - * * 0.5.2 Nov 16 2013 - * - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public - * - * * 0.5.1 Nov 12 2013 - * - Use node::MakeCallback() instead of direct v8::Function::Call() - * - * * 0.5.0 Nov 11 2013 - * - Added @TooTallNate as collaborator - * - New, much simpler, "include_dirs" for binding.gyp - * - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros - * - * * 0.4.4 Nov 2 2013 - * - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ - * - * * 0.4.3 Nov 2 2013 - * - Include node_object_wrap.h, removed from node.h for Node 0.11.8. - * - * * 0.4.2 Nov 2 2013 - * - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for - * Node 0.11.8 release. - * - * * 0.4.1 Sep 16 2013 - * - Added explicit `#include ` as it was removed from node.h for v0.11.8 - * - * * 0.4.0 Sep 2 2013 - * - Added NAN_INLINE and NAN_DEPRECATED and made use of them - * - Added NanError, NanTypeError and NanRangeError - * - Cleaned up code - * - * * 0.3.2 Aug 30 2013 - * - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent - * in NanAsyncWorker - * - * * 0.3.1 Aug 20 2013 - * - fix "not all control paths return a value" compile warning on some platforms - * - * * 0.3.0 Aug 19 2013 - * - Made NAN work with NPM - * - Lots of fixes to NanFromV8String, pulling in features from new Node core - * - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API - * - Added optional error number argument for NanThrowError() - * - Added NanInitPersistent() - * - Added NanReturnNull() and NanReturnEmptyString() - * - Added NanLocker and NanUnlocker - * - Added missing scopes - * - Made sure to clear disposed Persistent handles - * - Changed NanAsyncWorker to allocate error messages on the heap - * - Changed NanThrowError(Local) to NanThrowError(Handle) - * - Fixed leak in NanAsyncWorker when errmsg is used - * - * * 0.2.2 Aug 5 2013 - * - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() - * - * * 0.2.1 Aug 5 2013 - * - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for - * NanFromV8String() - * - * * 0.2.0 Aug 5 2013 - * - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, - * NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY - * - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, - * _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, - * _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, - * _NAN_PROPERTY_QUERY_ARGS - * - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer - * - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, - * NAN_WEAK_CALLBACK_DATA, NanMakeWeak - * - Renamed THROW_ERROR to _NAN_THROW_ERROR - * - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) - * - Added NanBufferUse(char*, uint32_t) - * - Added NanNewContextHandle(v8::ExtensionConfiguration*, - * v8::Handle, v8::Handle) - * - Fixed broken NanCallback#GetFunction() - * - Added optional encoding and size arguments to NanFromV8String() - * - Added NanGetPointerSafe() and NanSetPointerSafe() - * - Added initial test suite (to be expanded) - * - Allow NanUInt32OptionValue to convert any Number object - * - * * 0.1.0 Jul 21 2013 - * - Added `NAN_GETTER`, `NAN_SETTER` - * - Added `NanThrowError` with single Local argument - * - Added `NanNewBufferHandle` with single uint32_t argument - * - Added `NanHasInstance(Persistent&, Handle)` - * - Added `Local NanCallback#GetFunction()` - * - Added `NanCallback#Call(int, Local[])` - * - Deprecated `NanCallback#Run(int, Local[])` in favour of Call - * - * See https://github.com/rvagg/nan for the latest update to this file - **********************************************************************************/ - -#ifndef NAN_H_ -#define NAN_H_ - -#include -#include -#include -#include -#include -#include - -#if defined(__GNUC__) && !defined(DEBUG) -# define NAN_INLINE inline __attribute__((always_inline)) -#elif defined(_MSC_VER) && !defined(DEBUG) -# define NAN_INLINE __forceinline -#else -# define NAN_INLINE inline -#endif - -#if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __declspec(deprecated) -#else -# define NAN_DEPRECATED -#endif - -// some generic helpers - -template NAN_INLINE bool NanSetPointerSafe( - T *var - , T val -) { - if (var) { - *var = val; - return true; - } else { - return false; - } -} - -template NAN_INLINE T NanGetPointerSafe( - T *var - , T fallback = reinterpret_cast(0) -) { - if (var) { - return *var; - } else { - return fallback; - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt, bool def -) { - if (def) { - return optionsObj.IsEmpty() - || !optionsObj->Has(opt) - || optionsObj->Get(opt)->BooleanValue(); - } else { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->BooleanValue(); - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt -) { - return NanBooleanOptionValue(optionsObj, opt, false); -} - -NAN_INLINE uint32_t NanUInt32OptionValue( - v8::Local optionsObj - , v8::Handle opt - , uint32_t def -) { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->IsNumber() - ? optionsObj->Get(opt)->Uint32Value() - : def; -} - -#if (NODE_MODULE_VERSION > 0x000B) -// Node 0.11+ (0.11.3 and below won't compile with these) - -# define _NAN_METHOD_ARGS_TYPE const v8::FunctionCallbackInfo& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE void - -# define _NAN_GETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE void - -# define _NAN_SETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE void - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_DELETER_ARGS \ - _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE void - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE void - -# define _NAN_INDEX_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE void - -# define _NAN_INDEX_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE void - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE void - -# define _NAN_INDEX_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE void - -# define _NAN_INDEX_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE void - -typedef v8::FunctionCallback NanFunctionCallback; -static v8::Isolate* nan_isolate = v8::Isolate::GetCurrent(); - -# define NanUndefined() v8::Undefined(nan_isolate) -# define NanNull() v8::Null(nan_isolate) -# define NanTrue() v8::True(nan_isolate) -# define NanFalse() v8::False(nan_isolate) -# define NanAdjustExternalMemory(amount) \ - nan_isolate->AdjustAmountOfExternalAllocatedMemory(amount) -# define NanSetTemplate(templ, name, value) templ->Set(nan_isolate, name, value) -# define NanGetCurrentContext() nan_isolate->GetCurrentContext() -# define NanMakeCallback(target, func, argc, argv) \ - node::MakeCallback(nan_isolate, target, func, argc, argv) -# define NanGetInternalFieldPointer(object, index) \ - object->GetAlignedPointerFromInternalField(index) -# define NanSetInternalFieldPointer(object, index, value) \ - object->SetAlignedPointerInInternalField(index, value) - - template - NAN_INLINE v8::Local NanNew() { - return T::New(nan_isolate); - } - - template - NAN_INLINE v8::Local NanNew(P arg1) { - return T::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(nan_isolate, receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(nan_isolate, callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg1) { - return v8::Local::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg1) { - return v8::Local::New(nan_isolate, arg1); - } - - template - NAN_INLINE v8::Local NanNew(P arg1, int arg2) { - return T::New(nan_isolate, arg1, arg2); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(nan_isolate); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(nan_isolate, length); - } - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(nan_isolate, time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(nan_isolate, time).As(); - } - - typedef v8::UnboundScript NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(nan_isolate, resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(nan_isolate, resource); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New(nan_isolate, val).As(); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(nan_isolate, val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(nan_isolate, val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - char *arg - , int length) { - return v8::String::NewFromUtf8( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg - , int length) { - return v8::String::NewFromUtf8( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(char *arg) { - return v8::String::NewFromUtf8(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg) { - return v8::String::NewFromUtf8(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - return v8::String::NewFromOneByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - return v8::String::NewFromOneByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - nan_isolate - , arg - , v8::String::kNormalString - , length); - } - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg) { - return v8::String::NewFromTwoByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg) { - return v8::String::NewFromTwoByte(nan_isolate, arg); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(nan_isolate); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - nan_isolate->AddGCEpilogueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback) { - nan_isolate->RemoveGCEpilogueCallback(callback); - } - - NAN_INLINE void NanAddGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - nan_isolate->AddGCPrologueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback) { - nan_isolate->RemoveGCPrologueCallback(callback); - } - - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - nan_isolate->GetHeapStatistics(heap_statistics); - } - -# define NanSymbol(value) NanNew(value) - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Reset(nan_isolate, obj); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , const v8::Persistent& obj) { - handle.Reset(nan_isolate, obj); - } - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)( - const v8::WeakCallbackData >& data); - _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) - : parameter(param), callback(cb) { - NanAssignPersistent(persistent, handle); - } - - ~_NanWeakCallbackInfo() { - persistent.Reset(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - NAN_INLINE P* GetParameter() const { return info_->parameter; } - NAN_INLINE void Revive() const { - info_->persistent.SetWeak(info_, info_->callback); - } - - NAN_INLINE void Dispose() const { - delete info_; - } - - private: - _NanWeakCallbackInfo* info_; - }; - -// do not use for declaration -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name( \ - const v8::WeakCallbackData > &data) { \ - _NanWeakCallbackData wcbd( \ - data.GetParameter()); \ - _Nan_Weak_Callback_ ## name(wcbd); \ - } \ - \ - template \ - NAN_INLINE void _Nan_Weak_Callback_ ## name( \ - const _NanWeakCallbackData &data) - -# define NanScope() v8::HandleScope scope(nan_isolate) -# define NanEscapableScope() v8::EscapableHandleScope scope(nan_isolate) -# define NanEscapeScope(val) scope.Escape(val) -# define NanLocker() v8::Locker locker(nan_isolate) -# define NanUnlocker() v8::Unlocker unlocker(nan_isolate) -# define NanReturnValue(value) return args.GetReturnValue().Set(value) -# define NanReturnUndefined() return -# define NanReturnNull() return args.GetReturnValue().SetNull() -# define NanReturnEmptyString() return args.GetReturnValue().SetEmptyString() - -# define NanObjectWrapHandle(obj) obj->handle() - -template -void NAN_INLINE NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.SetWeak(cbinfo, callback); -} - -# define _NAN_ERROR(fun, errmsg) fun(NanNew(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - nan_isolate->ThrowException(_NAN_ERROR(fun, errmsg)); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(v8::Handle error) { - NanScope(); - nan_isolate->ThrowException(error); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(NanNew(msg)); - v8::Local obj = err.As(); - obj->Set(NanSymbol("code"), NanNew(errorNumber)); - return err; - } - - NAN_INLINE void NanThrowError( - const char *msg - , const int errorNumber - ) { - NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE void NanThrowTypeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE void NanThrowRangeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle - ) { - handle.Reset(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::smalloc::FreeCallback callback - , void *hint - ) { - return node::Buffer::New(nan_isolate, data, length, callback, hint); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { - return node::Buffer::New(nan_isolate, data, size); - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return node::Buffer::New(nan_isolate, size); - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return node::Buffer::Use(nan_isolate, data, size); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return NanNew(function_template)->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - return v8::Local::New( - nan_isolate - , v8::Context::New(nan_isolate, extensions, tmpl, obj) - ); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::Compile(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::Compile(nan_isolate, &source); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Local script - ) { - return script->BindToCurrentContext()->Run(); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Local script - ) { - return script->Run(); - } - -#else -// Node 0.8 and 0.10 - -# define _NAN_METHOD_ARGS_TYPE const v8::Arguments& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE v8::Handle - -# define _NAN_GETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_SETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_DELETER_ARGS _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE v8::Handle - -typedef v8::InvocationCallback NanFunctionCallback; - -# define NanUndefined() v8::Undefined() -# define NanNull() v8::Null() -# define NanTrue() v8::True() -# define NanFalse() v8::False() -# define NanAdjustExternalMemory(amount) \ - v8::V8::AdjustAmountOfExternalAllocatedMemory(amount) -# define NanSetTemplate(templ, name, value) templ->Set(name, value) -# define NanGetCurrentContext() v8::Context::GetCurrent() -# if NODE_VERSION_AT_LEAST(0, 8, 0) -# define NanMakeCallback(target, func, argc, argv) \ - node::MakeCallback(target, func, argc, argv) -# else -# define NanMakeCallback(target, func, argc, argv) \ - do { \ - v8::TryCatch try_catch; \ - func->Call(target, argc, argv); \ - if (try_catch.HasCaught()) { \ - v8::FatalException(try_catch); \ - } \ - } while (0) -# endif - -# define NanSymbol(value) v8::String::NewSymbol(value) - - template - NAN_INLINE v8::Local NanNew() { - return v8::Local::New(T::New()); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew(P arg) { - return v8::Local::New(T::New(arg)); - } - - template - NAN_INLINE v8::Local NanNew(P arg, int length) { - return v8::Local::New(T::New(arg, length)); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(length); - } - - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(time).As(); - } - - typedef v8::Script NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::New(s, const_cast(&origin)); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - return v8::Script::New(s); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(resource); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New(val).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - int length = strlen(reinterpret_cast(arg)); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - int length = strlen(reinterpret_cast(arg)); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::GCEpilogueCallback callback) { - v8::V8::RemoveGCEpilogueCallback(callback); - } - NAN_INLINE void NanAddGCPrologueCallback( - v8::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCPrologueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::GCPrologueCallback callback) { - v8::V8::RemoveGCPrologueCallback(callback); - } - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::V8::GetHeapStatistics(heap_statistics); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Dispose(); - handle = v8::Persistent::New(obj); - } - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)(v8::Persistent object, void* parameter); - _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) : - parameter(param) - , callback(cb) - , persistent(v8::Persistent::New(handle)) { } - - ~_NanWeakCallbackInfo() { - persistent.Dispose(); - persistent.Clear(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - NAN_INLINE P* GetParameter() const { return info_->parameter; } - NAN_INLINE void Revive() const { - info_->persistent.MakeWeak(info_, info_->callback); - } - NAN_INLINE void Dispose() const { - delete info_; - } - - private: - _NanWeakCallbackInfo* info_; - }; - -# define NanGetInternalFieldPointer(object, index) \ - object->GetPointerFromInternalField(index) -# define NanSetInternalFieldPointer(object, index, value) \ - object->SetPointerInInternalField(index, value) - -// do not use for declaration -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name( \ - v8::Persistent object, void *data) { \ - _NanWeakCallbackData wcbd( \ - static_cast<_NanWeakCallbackInfo*>(data)); \ - _Nan_Weak_Callback_ ## name(wcbd); \ - } \ - \ - template \ - NAN_INLINE void _Nan_Weak_Callback_ ## name( \ - const _NanWeakCallbackData &data) - - template - NAN_INLINE void NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.MakeWeak(cbinfo, callback); - } - -# define NanScope() v8::HandleScope scope -# define NanEscapableScope() v8::HandleScope scope -# define NanEscapeScope(val) scope.Close(val) -# define NanLocker() v8::Locker locker -# define NanUnlocker() v8::Unlocker unlocker -# define NanReturnValue(value) return scope.Close(value) -# define NanReturnUndefined() return v8::Undefined() -# define NanReturnNull() return v8::Null() -# define NanReturnEmptyString() return v8::String::Empty() -# define NanObjectWrapHandle(obj) v8::Local::New(obj->handle_) - -# define _NAN_ERROR(fun, errmsg) \ - fun(v8::String::New(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - return v8::Local::New( \ - v8::ThrowException(_NAN_ERROR(fun, errmsg))); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError( - v8::Handle error - ) { - NanScope(); - return v8::Local::New(v8::ThrowException(error)); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(v8::String::New(msg)); - v8::Local obj = err.As(); - obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber)); - return err; - } - - NAN_INLINE v8::Local NanThrowError( - const char *msg - , const int errorNumber - ) { - return NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowTypeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError( - const char* errmsg - ) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowRangeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template - NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle) { // NOLINT(runtime/references) - handle.Dispose(); - handle.Clear(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::Buffer::free_callback callback - , void *hint - ) { - return NanNew( - node::Buffer::New(data, length, callback, hint)->handle_); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { -#if NODE_MODULE_VERSION >= 0x000B - return NanNew(node::Buffer::New(data, size)->handle_); -#else - return NanNew( - node::Buffer::New(const_cast(data), size)->handle_); -#endif - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return NanNew(node::Buffer::New(size)->handle_); - } - - NAN_INLINE void FreeData(char *data, void *hint) { - delete[] data; - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return NanNew( - node::Buffer::New(data, size, FreeData, NULL)->handle_); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return function_template->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); - v8::Local lctx = NanNew(ctx); - ctx.Dispose(); - return lctx; - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::Compile(s, const_cast(&origin)); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - return v8::Script::Compile(s); - } - - NAN_INLINE v8::Local NanRunScript(v8::Local script) { - return script->Run(); - } - -#endif // NODE_MODULE_VERSION - -typedef void (*NanFreeCallback)(char *data, void *hint); - -#define NAN_METHOD(name) _NAN_METHOD_RETURN_TYPE name(_NAN_METHOD_ARGS) -#define NAN_GETTER(name) \ - _NAN_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_GETTER_ARGS) -#define NAN_SETTER(name) \ - _NAN_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_SETTER_ARGS) -#define NAN_PROPERTY_GETTER(name) \ - _NAN_PROPERTY_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_GETTER_ARGS) -#define NAN_PROPERTY_SETTER(name) \ - _NAN_PROPERTY_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_PROPERTY_SETTER_ARGS) -#define NAN_PROPERTY_ENUMERATOR(name) \ - _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name(_NAN_PROPERTY_ENUMERATOR_ARGS) -#define NAN_PROPERTY_DELETER(name) \ - _NAN_PROPERTY_DELETER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_DELETER_ARGS) -#define NAN_PROPERTY_QUERY(name) \ - _NAN_PROPERTY_QUERY_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_QUERY_ARGS) -# define NAN_INDEX_GETTER(name) \ - _NAN_INDEX_GETTER_RETURN_TYPE name(uint32_t index, _NAN_INDEX_GETTER_ARGS) -#define NAN_INDEX_SETTER(name) \ - _NAN_INDEX_SETTER_RETURN_TYPE name( \ - uint32_t index \ - , v8::Local value \ - , _NAN_INDEX_SETTER_ARGS) -#define NAN_INDEX_ENUMERATOR(name) \ - _NAN_INDEX_ENUMERATOR_RETURN_TYPE name(_NAN_INDEX_ENUMERATOR_ARGS) -#define NAN_INDEX_DELETER(name) \ - _NAN_INDEX_DELETER_RETURN_TYPE name( \ - uint32_t index \ - , _NAN_INDEX_DELETER_ARGS) -#define NAN_INDEX_QUERY(name) \ - _NAN_INDEX_QUERY_RETURN_TYPE name(uint32_t index, _NAN_INDEX_QUERY_ARGS) - -class NanCallback { - public: - NanCallback() { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - } - - explicit NanCallback(const v8::Handle &fn) { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - SetFunction(fn); - } - - ~NanCallback() { - if (handle.IsEmpty()) return; - NanDisposePersistent(handle); - } - - NAN_INLINE void SetFunction(const v8::Handle &fn) { - NanScope(); - NanNew(handle)->Set(NanSymbol("callback"), fn); - } - - NAN_INLINE v8::Local GetFunction () { - return NanNew(handle)->Get(NanSymbol("callback")) - .As(); - } - - void Call(int argc, v8::Handle argv[]) { - NanScope(); -#if (NODE_MODULE_VERSION > 0x000B) // 0.11.12+ - v8::Local callback = NanNew(handle)-> - Get(NanSymbol("callback")).As(); - node::MakeCallback( - nan_isolate - , nan_isolate->GetCurrentContext()->Global() - , callback - , argc - , argv - ); -#else -#if NODE_VERSION_AT_LEAST(0, 8, 0) - v8::Local callback = NanNew(handle)-> - Get(NanSymbol("callback")).As(); - node::MakeCallback( - v8::Context::GetCurrent()->Global() - , callback - , argc - , argv - ); -#else - node::MakeCallback(handle, "callback", argc, argv); -#endif -#endif - } - - private: - v8::Persistent handle; -}; - -/* abstract */ class NanAsyncWorker { - public: - explicit NanAsyncWorker(NanCallback *callback) : callback(callback) { - request.data = this; - errmsg = NULL; - - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(persistentHandle, obj); - } - - virtual ~NanAsyncWorker() { - NanScope(); - - if (!persistentHandle.IsEmpty()) - NanDisposePersistent(persistentHandle); - if (callback) - delete callback; - if (errmsg) - delete errmsg; - } - - virtual void WorkComplete() { - NanScope(); - - if (errmsg == NULL) - HandleOKCallback(); - else - HandleErrorCallback(); - delete callback; - callback = NULL; - } - - NAN_INLINE void SaveToPersistent(const char *key, v8::Local &obj) { - v8::Local handle = NanNew(persistentHandle); - handle->Set(NanSymbol(key), obj); - } - - v8::Local GetFromPersistent(const char *key) { - NanEscapableScope(); - v8::Local handle = NanNew(persistentHandle); - return NanEscapeScope(handle->Get(NanSymbol(key)).As()); - } - - virtual void Execute() = 0; - - uv_work_t request; - - protected: - v8::Persistent persistentHandle; - NanCallback *callback; - const char *errmsg; - - virtual void HandleOKCallback() { - NanScope(); - - callback->Call(0, NULL); - } - - virtual void HandleErrorCallback() { - NanScope(); - - v8::Local argv[] = { - v8::Exception::Error(NanNew(errmsg)) - }; - callback->Call(1, argv); - } -}; - -NAN_INLINE void NanAsyncExecute (uv_work_t* req) { - NanAsyncWorker *worker = static_cast(req->data); - worker->Execute(); -} - -NAN_INLINE void NanAsyncExecuteComplete (uv_work_t* req) { - NanAsyncWorker* worker = static_cast(req->data); - worker->WorkComplete(); - delete worker; -} - -NAN_INLINE void NanAsyncQueueWorker (NanAsyncWorker* worker) { - uv_queue_work( - uv_default_loop() - , &worker->request - , NanAsyncExecute - , (uv_after_work_cb)NanAsyncExecuteComplete - ); -} - -//// Base 64 //// - -#define _nan_base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) - -// Doesn't check for padding at the end. Can be 1-2 bytes over. -NAN_INLINE size_t _nan_base64_decoded_size_fast(size_t size) { - size_t remainder = size % 4; - - size = (size / 4) * 3; - if (remainder) { - if (size == 0 && remainder == 1) { - // special case: 1-byte input cannot be decoded - size = 0; - } else { - // non-padded input, add 1 or 2 extra bytes - size += 1 + (remainder == 3); - } - } - - return size; -} - -template -NAN_INLINE size_t _nan_base64_decoded_size( - const T* src - , size_t size -) { - if (size == 0) - return 0; - - if (src[size - 1] == '=') - size--; - if (size > 0 && src[size - 1] == '=') - size--; - - return _nan_base64_decoded_size_fast(size); -} - -// supports regular and URL-safe base64 -static const int _nan_unbase64_table[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63 - , 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1 - , -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63 - , -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 - , 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -}; - -#define _nan_unbase64(x) _nan_unbase64_table[(uint8_t)(x)] - -template static size_t _nan_base64_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - char* dst = buf; - char* dstEnd = buf + len; - const T* srcEnd = src + srcLen; - - while (src < srcEnd && dst < dstEnd) { - ptrdiff_t remaining = srcEnd - src; - char a, b, c, d; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining == 0 || *src == '=') break; - a = _nan_unbase64(*src++); - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 1 || *src == '=') break; - b = _nan_unbase64(*src++); - - *dst++ = (a << 2) | ((b & 0x30) >> 4); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 2 || *src == '=') break; - c = _nan_unbase64(*src++); - - *dst++ = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 3 || *src == '=') break; - d = _nan_unbase64(*src++); - - *dst++ = ((c & 0x03) << 6) | (d & 0x3F); - } - - return dst - buf; -} - -//// HEX //// - -template unsigned _nan_hex2bin(T c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return 10 + (c - 'A'); - if (c >= 'a' && c <= 'f') return 10 + (c - 'a'); - return static_cast(-1); -} - -template static size_t _nan_hex_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - size_t i; - for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { - unsigned a = _nan_hex2bin(src[i * 2 + 0]); - unsigned b = _nan_hex2bin(src[i * 2 + 1]); - if (!~a || !~b) return i; - buf[i] = a * 16 + b; - } - - return i; -} - -static bool _NanGetExternalParts( - v8::Handle val - , const char** data - , size_t* len -) { - if (node::Buffer::HasInstance(val)) { - *data = node::Buffer::Data(val.As()); - *len = node::Buffer::Length(val.As()); - return true; - } - - assert(val->IsString()); - v8::Local str = NanNew(val.As()); - - if (str->IsExternalAscii()) { - const v8::String::ExternalAsciiStringResource* ext; - ext = str->GetExternalAsciiStringResource(); - *data = ext->data(); - *len = ext->length(); - return true; - - } else if (str->IsExternal()) { - const v8::String::ExternalStringResource* ext; - ext = str->GetExternalStringResource(); - *data = reinterpret_cast(ext->data()); - *len = ext->length(); - return true; - } - - return false; -} - -namespace Nan { - enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; -} - -NAN_INLINE void* NanRawString( - v8::Handle from - , enum Nan::Encoding encoding - , size_t *datalen - , void *buf - , size_t buflen - , int flags -) { - NanScope(); - - size_t sz_; - size_t term_len = !(flags & v8::String::NO_NULL_TERMINATION); - char *data = NULL; - size_t len; - bool is_extern = _NanGetExternalParts( - from - , const_cast(&data) - , &len); - - if (is_extern && !term_len) { - NanSetPointerSafe(datalen, len); - return data; - } - - v8::Local toStr = from->ToString(); - - char *to = static_cast(buf); - - switch (encoding) { - case Nan::ASCII: -#if NODE_MODULE_VERSION < 0x000C - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteAscii(to, 0, static_cast(sz_ + term_len), flags)); - return to; -#endif - case Nan::BINARY: - case Nan::BUFFER: - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } -#if NODE_MODULE_VERSION < 0x000C - { - uint16_t* twobytebuf = new uint16_t[sz_ + term_len]; - - size_t len = toStr->Write(twobytebuf, 0, - static_cast(sz_ + term_len), flags); - - for (size_t i = 0; i < sz_ + term_len && i < len + term_len; i++) { - unsigned char *b = reinterpret_cast(&twobytebuf[i]); - to[i] = *b; - } - - NanSetPointerSafe(datalen, len); - - delete[] twobytebuf; - return to; - } -#else - NanSetPointerSafe( - datalen, - toStr->WriteOneByte( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags)); - return to; -#endif - case Nan::UTF8: - sz_ = toStr->Utf8Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteUtf8(to, static_cast(sz_ + term_len) - , NULL, flags) - - term_len); - return to; - case Nan::BASE64: - { - v8::String::Value value(toStr); - sz_ = _nan_base64_decoded_size(*value, value.length()); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len); - } - NanSetPointerSafe( - datalen - , _nan_base64_decode(to, sz_, *value, value.length())); - if (term_len) { - to[sz_] = '\0'; - } - return to; - } - case Nan::UCS2: - { - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[(sz_ + term_len) * 2]; - } else { - assert(buflen >= (sz_ + term_len) * 2 && "too small buffer"); - } - - int bc = 2 * toStr->Write( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags); - NanSetPointerSafe(datalen, bc); - return to; - } - case Nan::HEX: - { - v8::String::Value value(toStr); - sz_ = value.length(); - assert(!(sz_ & 1) && "bad hex data"); - if (to == NULL) { - to = new char[sz_ / 2 + term_len]; - } else { - assert(buflen >= sz_ / 2 + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , _nan_hex_decode(to, sz_ / 2, *value, value.length())); - } - if (term_len) { - to[sz_ / 2] = '\0'; - } - return to; - default: - assert(0 && "unknown encoding"); - } - return to; -} - -NAN_INLINE char* NanCString( - v8::Handle from - , size_t *datalen - , char *buf = NULL - , size_t buflen = 0 - , int flags = v8::String::NO_OPTIONS -) { - return static_cast( - NanRawString(from, Nan::UTF8, datalen, buf, buflen, flags) - ); -} - -#endif // NAN_H_ diff --git a/s4t-server-python/node_modules/websocket/node_modules/nan/package.json b/s4t-server-python/node_modules/websocket/node_modules/nan/package.json deleted file mode 100644 index 4918de2..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/nan/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "nan", - "version": "1.0.0", - "description": "Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility", - "main": "include_dirs.js", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/nan.git" - }, - "contributors": [ - { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - { - "name": "Benjamin Byholm", - "email": "bbyholm@abo.fi", - "url": "https://github.com/kkoopa/" - }, - { - "name": "Trevor Norris", - "email": "trev.norris@gmail.com", - "url": "https://github.com/trevnorris" - }, - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "https://github.com/TooTallNate" - }, - { - "name": "Brett Lawson", - "email": "brett19@gmail.com", - "url": "https://github.com/brett19" - }, - { - "name": "Ben Noordhuis", - "email": "info@bnoordhuis.nl", - "url": "https://github.com/bnoordhuis" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/rvagg/nan/issues" - }, - "homepage": "https://github.com/rvagg/nan", - "_id": "nan@1.0.0", - "dist": { - "shasum": "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38", - "tarball": "http://registry.npmjs.org/nan/-/nan-1.0.0.tgz" - }, - "_from": "nan@>=1.0.0 <1.1.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "directories": {}, - "_shasum": "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38", - "_resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.travis.yml b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.travis.yml deleted file mode 100644 index b3da453..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: -- '0.10' -env: - global: - - secure: i51rE9rZGHbcZWlL58j3H1qtL23OIV2r0X4TcQKNI3pw2mubdHFJmfPNNO19ItfReu8wwQMxOehKamwaNvqMiKWyHfn/QcThFQysqzgGZ6AgnUbYx9od6XFNDeWd1sVBf7QBAL07y7KWlYGWCwFwWjabSVySzQhEBdisPcskfkI= - - secure: BKq6/5z9LK3KDkTjs7BGeBZ1KsWgz+MsAXZ4P64NSeVGFaBdXU45+ww1mwxXFt5l22/mhyOQZfebQl+kGVqRSZ+DEgQeCymkNZ6CD8c6w6cLuOJXiXwuu/cDM2DD0tfGeu2YZC7yEikP7BqEFwH3D324rRzSGLF2RSAAwkOI7bE= diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.zuul.yml b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.zuul.yml deleted file mode 100644 index 030d270..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/.zuul.yml +++ /dev/null @@ -1,18 +0,0 @@ -ui: tape -browsers: - - name: chrome - version: 26..latest - - name: firefox - version: 21..latest - - name: safari - version: 5..latest - - name: ie - version: 6..latest - - name: opera - version: 12..latest - - name: iphone - version: 5.0..latest - - name: ipad - version: 5.0..latest - - name: android - version: 4.0..latest diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/LICENSE b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/LICENSE deleted file mode 100644 index 0c068ce..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/README.md b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/README.md deleted file mode 100644 index efcff69..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# typedarray-to-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] - -#### Convert a typed array to a [Buffer](https://github.com/feross/buffer) without a copy. - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[travis-image]: https://img.shields.io/travis/feross/typedarray-to-buffer.svg?style=flat -[travis-url]: https://travis-ci.org/feross/typedarray-to-buffer -[npm-image]: https://img.shields.io/npm/v/typedarray-to-buffer.svg?style=flat -[npm-url]: https://npmjs.org/package/typedarray-to-buffer -[downloads-image]: https://img.shields.io/npm/dm/typedarray-to-buffer.svg?style=flat -[saucelabs-image]: https://saucelabs.com/browser-matrix/typedarray-to-buffer.svg -[saucelabs-url]: https://saucelabs.com/u/typedarray-to-buffer - -Say you're using the ['buffer'](https://github.com/feross/buffer) module on npm, or -[browserify](http://browserify.org/) and you're working with lots of binary data. - -Unfortunately, sometimes the browser or someone else's API gives you an `ArrayBuffer` -or a typed array like `Uint8Array` to work with and you need to convert it to a -`Buffer`. What do you do? - -Of course: `new Buffer(uint8array)` - -But, alas, every time you do `new Buffer(uint8array)` **the entire array gets copied**. -The `Buffer` constructor does a copy; this is -defined by the [node docs](http://nodejs.org/api/buffer.html) and the 'buffer' module -matches the node API exactly. - -So, how can we avoid this expensive copy in -[performance critical applications](https://github.com/feross/buffer/issues/22)? - -***Simply use this module, of course!*** - -## install - -```bash -npm install typedarray-to-buffer -``` - -## usage - -To convert a typed array to a `Buffer` **without a copy**, do this: - -```js -var toBuffer = require('typedarray-to-buffer') - -var arr = new Uint8Array([1, 2, 3]) -arr = toBuffer(arr) - -// arr is a buffer now! - -arr.toString() // '\u0001\u0002\u0003' -arr.readUInt16BE(0) // 258 -``` - -## how it works - -If the browser supports typed arrays, then `toBuffer` will **augment the typed array** you -pass in with the `Buffer` methods and return it. See [how does Buffer -work?](https://github.com/feross/buffer#how-does-it-work) for more about how augmentation -works. - -This module uses the typed array's underlying `ArrayBuffer` to back the new `Buffer`. This -respects the "view" on the `ArrayBuffer`, i.e. `byteOffset` and `byteLength`. In other -words, if you do `toBuffer(new Uint32Array([1, 2, 3]))`, then the new `Buffer` will -contain `[1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]`, **not** `[1, 2, 3]`. And it still doesn't -require a copy. - -If the browser doesn't support typed arrays, then `toBuffer` will create a new `Buffer` -object, copy the data into it, and return it. There's no simple performance optimization -we can do for old browsers. Oh well. - -If this module is used in node, then it will just call `new Buffer`. This is just for -the convenience of modules that work in both node and the browser. - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/index.js b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/index.js deleted file mode 100644 index 674d513..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Convert a typed array to a Buffer without a copy - * - * Author: Feross Aboukhadijeh - * License: MIT - * - * `npm install typedarray-to-buffer` - */ - -var isTypedArray = require('is-typedarray').strict - -module.exports = function (arr) { - // If `Buffer` is the browser `buffer` module, and the browser supports typed arrays, - // then avoid a copy. Otherwise, create a `Buffer` with a copy. - var constructor = Buffer.TYPED_ARRAY_SUPPORT - ? Buffer._augment - : function (arr) { return new Buffer(arr) } - - if (arr instanceof Uint8Array) { - return constructor(arr) - } else if (arr instanceof ArrayBuffer) { - return constructor(new Uint8Array(arr)) - } else if (isTypedArray(arr)) { - // Use the typed array's underlying ArrayBuffer to back new Buffer. This respects - // the "view" on the ArrayBuffer, i.e. byteOffset and byteLength. No copy. - return constructor(new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength)) - } else { - // Unsupported type, just pass it through to the `Buffer` constructor. - return new Buffer(arr) - } -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/LICENSE.md b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/LICENSE.md deleted file mode 100644 index ee27ba4..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/LICENSE.md +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/README.md b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/README.md deleted file mode 100644 index 2752863..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# is-typedarray [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Detect whether or not an object is a -[Typed Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). - -## Usage - -[![NPM](https://nodei.co/npm/is-typedarray.png)](https://nodei.co/npm/is-typedarray/) - -### isTypedArray(array) - -Returns `true` when array is a Typed Array, and `false` when it is not. - -## License - -MIT. See [LICENSE.md](http://github.com/hughsk/is-typedarray/blob/master/LICENSE.md) for details. diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js deleted file mode 100644 index 0631b85..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/index.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = isTypedArray -isTypedArray.strict = isStrictTypedArray -isTypedArray.loose = isLooseTypedArray - -var toString = Object.prototype.toString -var names = { - '[object Int8Array]': true - , '[object Int16Array]': true - , '[object Int32Array]': true - , '[object Uint8Array]': true - , '[object Uint16Array]': true - , '[object Uint32Array]': true - , '[object Float32Array]': true - , '[object Float64Array]': true -} - -function isTypedArray(arr) { - return ( - isStrictTypedArray(arr) - || isLooseTypedArray(arr) - ) -} - -function isStrictTypedArray(arr) { - return ( - arr instanceof Int8Array - || arr instanceof Int16Array - || arr instanceof Int32Array - || arr instanceof Uint8Array - || arr instanceof Uint16Array - || arr instanceof Uint32Array - || arr instanceof Float32Array - || arr instanceof Float64Array - ) -} - -function isLooseTypedArray(arr) { - return names[toString.call(arr)] -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/package.json b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/package.json deleted file mode 100644 index 736053c..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "is-typedarray", - "version": "0.0.0", - "description": "Detect whether or not an object is a Typed Array", - "main": "index.js", - "scripts": { - "test": "node test" - }, - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "tape": "^2.13.1" - }, - "repository": { - "type": "git", - "url": "git://github.com/hughsk/is-typedarray.git" - }, - "keywords": [ - "typed", - "array", - "detect", - "is", - "util" - ], - "bugs": { - "url": "https://github.com/hughsk/is-typedarray/issues" - }, - "homepage": "https://github.com/hughsk/is-typedarray", - "_id": "is-typedarray@0.0.0", - "_shasum": "9e5c50a8bf17b3051b48c5e5b678440821f756f4", - "_from": "is-typedarray@0.0.0", - "_npmVersion": "1.4.10", - "_npmUser": { - "name": "hughsk", - "email": "hughskennedy@gmail.com" - }, - "maintainers": [ - { - "name": "hughsk", - "email": "hughskennedy@gmail.com" - } - ], - "dist": { - "shasum": "9e5c50a8bf17b3051b48c5e5b678440821f756f4", - "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-0.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-0.0.0.tgz" -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/test.js b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/test.js deleted file mode 100644 index b0c176f..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/node_modules/is-typedarray/test.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tape') -var ista = require('./') - -test('strict', function(t) { - t.ok(ista.strict(new Int8Array), 'Int8Array') - t.ok(ista.strict(new Int16Array), 'Int16Array') - t.ok(ista.strict(new Int32Array), 'Int32Array') - t.ok(ista.strict(new Uint8Array), 'Uint8Array') - t.ok(ista.strict(new Uint16Array), 'Uint16Array') - t.ok(ista.strict(new Uint32Array), 'Uint32Array') - t.ok(ista.strict(new Float32Array), 'Float32Array') - t.ok(ista.strict(new Float64Array), 'Float64Array') - - t.ok(!ista.strict(new Array), 'Array') - t.ok(!ista.strict([]), '[]') - - t.end() -}) - -test('loose', function(t) { - t.ok(ista.loose(new Int8Array), 'Int8Array') - t.ok(ista.loose(new Int16Array), 'Int16Array') - t.ok(ista.loose(new Int32Array), 'Int32Array') - t.ok(ista.loose(new Uint8Array), 'Uint8Array') - t.ok(ista.loose(new Uint16Array), 'Uint16Array') - t.ok(ista.loose(new Uint32Array), 'Uint32Array') - t.ok(ista.loose(new Float32Array), 'Float32Array') - t.ok(ista.loose(new Float64Array), 'Float64Array') - - t.ok(!ista.loose(new Array), 'Array') - t.ok(!ista.loose([]), '[]') - - t.end() -}) diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/package.json b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/package.json deleted file mode 100644 index 5ef6bd0..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "typedarray-to-buffer", - "description": "Convert a typed array to a Buffer without a copy", - "version": "3.0.1", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org/" - }, - "bugs": { - "url": "https://github.com/feross/typedarray-to-buffer/issues" - }, - "dependencies": { - "is-typedarray": "0.0.0" - }, - "devDependencies": { - "tape": "2.x", - "zuul": "^1.13.0" - }, - "homepage": "http://feross.org", - "keywords": [ - "buffer", - "typed array", - "convert", - "no copy", - "uint8array", - "uint16array", - "uint32array", - "int16array", - "int32array", - "float32array", - "float64array", - "browser", - "arraybuffer", - "dataview" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/feross/typedarray-to-buffer.git" - }, - "scripts": { - "test": "npm run test-node && npm run test-browser", - "test-browser": "zuul -- test/*.js", - "test-browser-local": "zuul --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "testling": { - "files": "test/*.js" - }, - "gitHead": "9eedd9f5ac9dd881a6ca0215b2eba45afa31691a", - "_id": "typedarray-to-buffer@3.0.1", - "_shasum": "de0a601da46a9475b1fc65922c93d9a7c1937f49", - "_from": "typedarray-to-buffer@>=3.0.0 <3.1.0", - "_npmVersion": "2.1.11", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "feross", - "email": "feross@feross.org" - }, - "maintainers": [ - { - "name": "feross", - "email": "feross@feross.org" - } - ], - "dist": { - "shasum": "de0a601da46a9475b1fc65922c93d9a7c1937f49", - "tarball": "http://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/test/basic.js b/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/test/basic.js deleted file mode 100644 index d1aa9de..0000000 --- a/s4t-server-python/node_modules/websocket/node_modules/typedarray-to-buffer/test/basic.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tape') -var toBuffer = require('../') - -test('convert to buffer from Uint8Array', function (t) { - if (typeof Uint8Array !== 'undefined') { - var arr = new Uint8Array([1, 2, 3]) - arr = toBuffer(arr) - - t.deepEqual(arr, new Buffer([1, 2, 3]), 'contents equal') - t.ok(Buffer.isBuffer(arr), 'is buffer') - t.equal(arr.readUInt8(0), 1) - t.equal(arr.readUInt8(1), 2) - t.equal(arr.readUInt8(2), 3) - } else { - t.pass('browser lacks Uint8Array support, skip test') - } - t.end() -}) - -test('convert to buffer from another arrayview type (Uint32Array)', function (t) { - if (typeof Uint32Array !== 'undefined') { - var arr = new Uint32Array([1, 2, 3]) - arr = toBuffer(arr) - - t.deepEqual(arr, new Buffer([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]), 'contents equal') - t.ok(Buffer.isBuffer(arr), 'is buffer') - t.equal(arr.readUInt32LE(0), 1) - t.equal(arr.readUInt32LE(4), 2) - t.equal(arr.readUInt32LE(8), 3) - t.equal(arr instanceof Uint8Array, !!Buffer.TYPED_ARRAY_SUPPORT) - - } else { - t.pass('browser lacks Uint32Array support, skip test') - } - t.end() -}) - -test('convert to buffer from ArrayBuffer', function (t) { - if (typeof Uint32Array !== 'undefined') { - var arr = new Uint32Array([1, 2, 3]).subarray(1, 2) - arr = toBuffer(arr) - - t.deepEqual(arr, new Buffer([2, 0, 0, 0]), 'contents equal') - t.ok(Buffer.isBuffer(arr), 'is buffer') - t.equal(arr.readUInt32LE(0), 2) - t.equal(arr instanceof Uint8Array, !!Buffer.TYPED_ARRAY_SUPPORT) - - } else { - t.pass('browser lacks ArrayBuffer support, skip test') - } - t.end() -}) diff --git a/s4t-server-python/node_modules/websocket/package.json b/s4t-server-python/node_modules/websocket/package.json deleted file mode 100644 index defa3f0..0000000 --- a/s4t-server-python/node_modules/websocket/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "websocket", - "description": "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", - "keywords": [ - "websocket", - "websockets", - "socket", - "networking", - "comet", - "push", - "RFC-6455", - "realtime", - "server", - "client" - ], - "author": { - "name": "Brian McKelvey", - "email": "brian@worlize.com", - "url": "https://www.worlize.com/" - }, - "version": "1.0.17", - "repository": { - "type": "git", - "url": "https://github.com/theturtle32/WebSocket-Node.git" - }, - "homepage": "https://github.com/theturtle32/WebSocket-Node", - "engines": { - "node": ">=0.8.0" - }, - "dependencies": { - "debug": "~2.1.0", - "nan": "~1.0.0", - "typedarray-to-buffer": "~3.0.0" - }, - "devDependencies": { - "buffer-equal": "0.0.1", - "faucet": "0.0.1", - "gulp": "git+https://github.com/gulpjs/gulp.git#4.0", - "gulp-jshint": "^1.9.0", - "jshint-stylish": "^1.0.0", - "tape": "^3.0.0" - }, - "config": { - "verbose": false - }, - "scripts": { - "install": "(node-gyp rebuild 2> builderror.log) || (exit 0)", - "test": "faucet test/unit", - "gulp": "gulp" - }, - "main": "index", - "directories": { - "lib": "./lib" - }, - "browser": "lib/browser.js", - "gitHead": "cda940b883aa884906ac13158fe514229a67f426", - "bugs": { - "url": "https://github.com/theturtle32/WebSocket-Node/issues" - }, - "_id": "websocket@1.0.17", - "_shasum": "8a572afc6ec120eb41473ca517d07d932f7b6a1c", - "_from": "websocket@*", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "theturtle32", - "email": "brian@worlize.com" - }, - "maintainers": [ - { - "name": "theturtle32", - "email": "brian@worlize.com" - } - ], - "dist": { - "shasum": "8a572afc6ec120eb41473ca517d07d932f7b6a1c", - "tarball": "http://registry.npmjs.org/websocket/-/websocket-1.0.17.tgz" - }, - "_resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.17.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/s4t-server-python/node_modules/websocket/src/bufferutil.cc b/s4t-server-python/node_modules/websocket/src/bufferutil.cc deleted file mode 100644 index 916ec17..0000000 --- a/s4t-server-python/node_modules/websocket/src/bufferutil.cc +++ /dev/null @@ -1,117 +0,0 @@ -/*! - * BufferUtil originally from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "nan.h" - -using namespace v8; -using namespace node; - -class BufferUtil : public ObjectWrap -{ -public: - - static void Initialize(v8::Handle target) - { - NanScope(); - Local t = NanNew(New); - t->InstanceTemplate()->SetInternalFieldCount(1); - NODE_SET_METHOD(t, "unmask", BufferUtil::Unmask); - NODE_SET_METHOD(t, "mask", BufferUtil::Mask); - NODE_SET_METHOD(t, "merge", BufferUtil::Merge); - target->Set(NanSymbol("BufferUtil"), t->GetFunction()); - } - -protected: - - static NAN_METHOD(New) - { - NanScope(); - BufferUtil* bufferUtil = new BufferUtil(); - bufferUtil->Wrap(args.This()); - NanReturnValue(args.This()); - } - - static NAN_METHOD(Merge) - { - NanScope(); - Local bufferObj = args[0]->ToObject(); - char* buffer = Buffer::Data(bufferObj); - Local array = Local::Cast(args[1]); - unsigned int arrayLength = array->Length(); - size_t offset = 0; - unsigned int i; - for (i = 0; i < arrayLength; ++i) { - Local src = array->Get(i)->ToObject(); - size_t length = Buffer::Length(src); - memcpy(buffer + offset, Buffer::Data(src), length); - offset += length; - } - NanReturnValue(NanTrue()); - } - - static NAN_METHOD(Unmask) - { - NanScope(); - Local buffer_obj = args[0]->ToObject(); - size_t length = Buffer::Length(buffer_obj); - Local mask_obj = args[1]->ToObject(); - unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); - unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); - size_t len32 = length / 4; - unsigned int i; - for (i = 0; i < len32; ++i) *(from + i) ^= *mask; - from += i; - switch (length % 4) { - case 3: *((unsigned char*)from+2) = *((unsigned char*)from+2) ^ ((unsigned char*)mask)[2]; - case 2: *((unsigned char*)from+1) = *((unsigned char*)from+1) ^ ((unsigned char*)mask)[1]; - case 1: *((unsigned char*)from ) = *((unsigned char*)from ) ^ ((unsigned char*)mask)[0]; - case 0:; - } - NanReturnValue(NanTrue()); - } - - static NAN_METHOD(Mask) - { - NanScope(); - Local buffer_obj = args[0]->ToObject(); - Local mask_obj = args[1]->ToObject(); - unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); - Local output_obj = args[2]->ToObject(); - unsigned int dataOffset = args[3]->Int32Value(); - unsigned int length = args[4]->Int32Value(); - unsigned int* to = (unsigned int*)(Buffer::Data(output_obj) + dataOffset); - unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); - unsigned int len32 = length / 4; - unsigned int i; - for (i = 0; i < len32; ++i) *(to + i) = *(from + i) ^ *mask; - to += i; - from += i; - switch (length % 4) { - case 3: *((unsigned char*)to+2) = *((unsigned char*)from+2) ^ *((unsigned char*)mask+2); - case 2: *((unsigned char*)to+1) = *((unsigned char*)from+1) ^ *((unsigned char*)mask+1); - case 1: *((unsigned char*)to ) = *((unsigned char*)from ) ^ *((unsigned char*)mask); - case 0:; - } - NanReturnValue(NanTrue()); - } -}; - -extern "C" void init (Handle target) -{ - NanScope(); - BufferUtil::Initialize(target); -} - -NODE_MODULE(bufferutil, init) diff --git a/s4t-server-python/node_modules/websocket/src/validation.cc b/s4t-server-python/node_modules/websocket/src/validation.cc deleted file mode 100644 index 755f290..0000000 --- a/s4t-server-python/node_modules/websocket/src/validation.cc +++ /dev/null @@ -1,145 +0,0 @@ -/*! - * UTF-8 Validation Code originally from: - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -#include -#include -#include -#include -#include -#include -#include -#include "nan.h" - -using namespace v8; -using namespace node; - -#define UNI_SUR_HIGH_START (uint32_t) 0xD800 -#define UNI_SUR_LOW_END (uint32_t) 0xDFFF -#define UNI_REPLACEMENT_CHAR (uint32_t) 0x0000FFFD -#define UNI_MAX_LEGAL_UTF32 (uint32_t) 0x0010FFFF - -static const uint8_t trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -static const uint32_t offsetsFromUTF8[6] = { - 0x00000000, 0x00003080, 0x000E2080, - 0x03C82080, 0xFA082080, 0x82082080 -}; - -static int isLegalUTF8(const uint8_t *source, const int length) -{ - uint8_t a; - const uint8_t *srcptr = source+length; - switch (length) { - default: return 0; - /* Everything else falls through when "true"... */ - /* RFC3629 makes 5 & 6 bytes UTF-8 illegal - case 6: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 5: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; */ - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; - case 2: if ((a = (*--srcptr)) > 0xBF) return 0; - switch (*source) { - /* no fall-through in this inner switch */ - case 0xE0: if (a < 0xA0) return 0; break; - case 0xED: if (a > 0x9F) return 0; break; - case 0xF0: if (a < 0x90) return 0; break; - case 0xF4: if (a > 0x8F) return 0; break; - default: if (a < 0x80) return 0; - } - - case 1: if (*source >= 0x80 && *source < 0xC2) return 0; - } - if (*source > 0xF4) return 0; - return 1; -} - -int is_valid_utf8 (size_t len, char *value) -{ - /* is the string valid UTF-8? */ - for (unsigned int i = 0; i < len; i++) { - uint32_t ch = 0; - uint8_t extrabytes = trailingBytesForUTF8[(uint8_t) value[i]]; - - if (extrabytes + i >= len) - return 0; - - if (isLegalUTF8 ((uint8_t *) (value + i), extrabytes + 1) == 0) return 0; - - switch (extrabytes) { - case 5 : ch += (uint8_t) value[i++]; ch <<= 6; - case 4 : ch += (uint8_t) value[i++]; ch <<= 6; - case 3 : ch += (uint8_t) value[i++]; ch <<= 6; - case 2 : ch += (uint8_t) value[i++]; ch <<= 6; - case 1 : ch += (uint8_t) value[i++]; ch <<= 6; - case 0 : ch += (uint8_t) value[i]; - } - - ch -= offsetsFromUTF8[extrabytes]; - - if (ch <= UNI_MAX_LEGAL_UTF32) { - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) - return 0; - } else { - return 0; - } - } - - return 1; -} - -class Validation : public ObjectWrap -{ -public: - - static void Initialize(v8::Handle target) - { - NanScope(); - Local t = NanNew(New); - t->InstanceTemplate()->SetInternalFieldCount(1); - NODE_SET_METHOD(t, "isValidUTF8", Validation::IsValidUTF8); - target->Set(NanSymbol("Validation"), t->GetFunction()); - } - -protected: - - static NAN_METHOD(New) - { - NanScope(); - Validation* validation = new Validation(); - validation->Wrap(args.This()); - NanReturnValue(args.This()); - } - - static NAN_METHOD(IsValidUTF8) - { - NanScope(); - if (!Buffer::HasInstance(args[0])) { - return NanThrowTypeError("First argument needs to be a buffer"); - } - Local buffer_obj = args[0]->ToObject(); - char *buffer_data = Buffer::Data(buffer_obj); - size_t buffer_length = Buffer::Length(buffer_obj); - NanReturnValue(is_valid_utf8(buffer_length, buffer_data) == 1 ? NanTrue() : NanFalse()); - } -}; - -extern "C" void init (Handle target) -{ - NanScope(); - Validation::Initialize(target); -} - -NODE_MODULE(validation, init) diff --git a/s4t-server-python/node_modules/websocket/vendor/FastBufferList.js b/s4t-server-python/node_modules/websocket/vendor/FastBufferList.js deleted file mode 100644 index 695fc33..0000000 --- a/s4t-server-python/node_modules/websocket/vendor/FastBufferList.js +++ /dev/null @@ -1,192 +0,0 @@ -// This file was copied from https://github.com/substack/node-bufferlist -// and modified to be able to copy bytes from the bufferlist directly into -// a pre-existing fixed-size buffer without an additional memory allocation. - -// bufferlist.js -// Treat a linked list of buffers as a single variable-size buffer. -var Buffer = require('buffer').Buffer; -var EventEmitter = require('events').EventEmitter; - -module.exports = BufferList; -module.exports.BufferList = BufferList; // backwards compatibility - -function BufferList(opts) { - if (!(this instanceof BufferList)) return new BufferList(opts); - EventEmitter.call(this); - var self = this; - - if (typeof(opts) == 'undefined') opts = {}; - - // default encoding to use for take(). Leaving as 'undefined' - // makes take() return a Buffer instead. - self.encoding = opts.encoding; - - // constructor to use for Buffer-esque operations - self.construct = opts.construct || Buffer; - - var head = { next : null, buffer : null }; - var last = { next : null, buffer : null }; - - // length can get negative when advanced past the end - // and this is the desired behavior - var length = 0; - self.__defineGetter__('length', function () { - return length; - }); - - // keep an offset of the head to decide when to head = head.next - var offset = 0; - - // Write to the bufferlist. Emits 'write'. Always returns true. - self.write = function (buf) { - if (!head.buffer) { - head.buffer = buf; - last = head; - } - else { - last.next = { next : null, buffer : buf }; - last = last.next; - } - length += buf.length; - self.emit('write', buf); - return true; - }; - - self.end = function (buf) { - if (Buffer.isBuffer(buf)) self.write(buf); - }; - - // Push buffers to the end of the linked list. (deprecated) - // Return this (self). - self.push = function () { - var args = [].concat.apply([], arguments); - args.forEach(self.write); - return self; - }; - - // For each buffer, perform some action. - // If fn's result is a true value, cut out early. - // Returns this (self). - self.forEach = function (fn) { - if (!head.buffer) return new self.construct(0); - - if (head.buffer.length - offset <= 0) return self; - var firstBuf = head.buffer.slice(offset); - - var b = { buffer : firstBuf, next : head.next }; - - while (b && b.buffer) { - var r = fn(b.buffer); - if (r) break; - b = b.next; - } - - return self; - }; - - // Create a single Buffer out of all the chunks or some subset specified by - // start and one-past the end (like slice) in bytes. - self.join = function (start, end) { - if (!head.buffer) return new self.construct(0); - if (start == undefined) start = 0; - if (end == undefined) end = self.length; - - var big = new self.construct(end - start); - var ix = 0; - self.forEach(function (buffer) { - if (start < (ix + buffer.length) && ix < end) { - // at least partially contained in the range - buffer.copy( - big, - Math.max(0, ix - start), - Math.max(0, start - ix), - Math.min(buffer.length, end - ix) - ); - } - ix += buffer.length; - if (ix > end) return true; // stop processing past end - }); - - return big; - }; - - self.joinInto = function (targetBuffer, targetStart, sourceStart, sourceEnd) { - if (!head.buffer) return new self.construct(0); - if (sourceStart == undefined) sourceStart = 0; - if (sourceEnd == undefined) sourceEnd = self.length; - - var big = targetBuffer; - if (big.length - targetStart < sourceEnd - sourceStart) { - throw new Error("Insufficient space available in target Buffer."); - } - var ix = 0; - self.forEach(function (buffer) { - if (sourceStart < (ix + buffer.length) && ix < sourceEnd) { - // at least partially contained in the range - buffer.copy( - big, - Math.max(targetStart, targetStart + ix - sourceStart), - Math.max(0, sourceStart - ix), - Math.min(buffer.length, sourceEnd - ix) - ); - } - ix += buffer.length; - if (ix > sourceEnd) return true; // stop processing past end - }); - - return big; - }; - - // Advance the buffer stream by n bytes. - // If n the aggregate advance offset passes the end of the buffer list, - // operations such as .take() will return empty strings until enough data is - // pushed. - // Returns this (self). - self.advance = function (n) { - offset += n; - length -= n; - while (head.buffer && offset >= head.buffer.length) { - offset -= head.buffer.length; - head = head.next - ? head.next - : { buffer : null, next : null } - ; - } - self.emit('advance', n); - return self; - }; - - // Take n bytes from the start of the buffers. - // Returns a string. - // If there are less than n bytes in all the buffers or n is undefined, - // returns the entire concatenated buffer string. - self.take = function (n, encoding) { - if (n == undefined) n = self.length; - else if (typeof n !== 'number') { - encoding = n; - n = self.length; - } - var b = head; - if (!encoding) encoding = self.encoding; - if (encoding) { - var acc = ''; - self.forEach(function (buffer) { - if (n <= 0) return true; - acc += buffer.toString( - encoding, 0, Math.min(n,buffer.length) - ); - n -= buffer.length; - }); - return acc; - } else { - // If no 'encoding' is specified, then return a Buffer. - return self.join(0, n); - } - }; - - // The entire concatenated buffer as a string. - self.toString = function () { - return self.take('binary'); - }; -} -require('util').inherits(BufferList, EventEmitter); diff --git a/s4t-server-python/s4t-wamp-server.py b/s4t-server-python/s4t-wamp-server.py index dc8f048..9c70732 100644 --- a/s4t-server-python/s4t-wamp-server.py +++ b/s4t-server-python/s4t-wamp-server.py @@ -27,11 +27,30 @@ from autobahn.twisted.wamp import ApplicationSession from autobahn.twisted.wamp import ApplicationRunner from twisted.internet.defer import inlineCallbacks -urlWampRouter = "ws://172.17.3.139:8181/ws" +from autobahn.twisted.websocket import WampWebSocketClientFactory +from autobahn.wamp.types import ComponentConfig + +urlWampRouter = "ws://212.189.207.109:8181/ws" realmWampRouter = "s4t" +''' +class ApplicationSessionFactory(ApplicationSessionFactory): + def __init__(self, config, app): + ApplicationSession.__init__(self, config) + self.app = app + +class ApplicationFactory(Application): + + + def __init__(self, prefix= None): + +''' + class S4TWampServer(ApplicationSession): + + + @inlineCallbacks def onJoin(self, details): self.connectedBoard = {} @@ -69,11 +88,49 @@ class s4_wamp_server: self.topic_connection = t_connection self.topic_command = t_command - def start(self): - self.runner = ApplicationRunner(url = urlWampRouter, realm = realmWampRouter, extra={'topic_connection':self.topic_connection, 'topic_command':self.topic_command}) - self.runner.run(S4TWampServer) + def start(self,make): + #self.runner = ApplicationRunner(url = urlWampRouter, realm = realmWampRouter, extra={'topic_connection':self.topic_connection, 'topic_command':self.topic_command}) + #self.runner.run(S4TWampServer) + self.url = urlWampRouter + self.realm = realmWampRouter + self.extra = {'topic_connection':self.topic_connection, 'topic_command':self.topic_command} + self.debug = True + self.debug_wamp = True + self.debug_app = True + self.make = None + + from twisted.internet import reactor + ## factory for use ApplicationSession + def create(): + cfg = ComponentConfig(self.realm, self.extra) + try: + session = make(cfg) + except Exception: + ## the app component could not be created .. fatal + log.err() + reactor.stop() + else: + session.debug_app = self.debug_app + return session + + ## create a WAMP-over-WebSocket transport client factory + transport_factory = WampWebSocketClientFactory(create, url = self.url, + debug = self.debug, debug_wamp = self.debug_wamp) + + ## start the client from a Twisted endpoint + from twisted.internet.endpoints import clientFromString + + endpoint_descriptor = "tcp:212.189.207.109:8181" + + client = clientFromString(reactor, endpoint_descriptor) + client.connect(transport_factory) + + ## now enter the Twisted reactor loop + + reactor.run() + if __name__ == '__main__': server = s4_wamp_server('board.connection', 'board.command') - server.start() \ No newline at end of file + server.start(S4TWampServer) \ No newline at end of file diff --git a/s4t-server-python/test_3.py b/s4t-server-python/test_autobahn_wamp_client.py similarity index 77% rename from s4t-server-python/test_3.py rename to s4t-server-python/test_autobahn_wamp_client.py index 94c7402..a07363b 100644 --- a/s4t-server-python/test_3.py +++ b/s4t-server-python/test_autobahn_wamp_client.py @@ -5,29 +5,41 @@ from autobahn.twisted.websocket import WebSocketClientProtocol from autobahn.twisted.websocket import WebSocketClientFactory from autobahn.twisted.websocket import connectWS +from autobahn.twisted.wamp import ApplicationSessionFactory + from twisted.internet import reactor -from twisted.python import log -import sys -log.startLogging(sys.stdout) +#from twisted.python import log +#import sys +#log.startLogging(sys.stdout) import threading import Queue # ----- twisted ---------- +class MyAppComponent(ApplicationSession): + + def onJoin(self, details): + if not self.factory._myAppSession: + self.factory._myAppSession = self + +def onLeave(self, details): + if self.factory._myAppSession == self: + self.factory._myAppSession = None + #------------------------------------------------------- class _WampClientProtocol(WampWebSocketClientProtocol): def __init__(self, factory): self.factory = factory def onOpen(self): - log.msg("Client connected") + #log.msg("Client connected") self.factory.protocol_instance = self self.factory.base_client._connected_event.set() #-------------------------------------------------------- class _WampClientFactory(WampWebSocketClientFactory): - def __init__(self, *args, **kwargs): - WampWebSocketClientFactory.__init__(self, *args, **kwargs) + def __init__(self, factory, *args, **kwargs): + WampWebSocketClientFactory.__init__(self, factory, *args, **kwargs) self.protocol_instance = None self.base_client = None @@ -35,7 +47,7 @@ class _WampClientFactory(WampWebSocketClientFactory): return _WampClientProtocol(self) #------------------------------------------------------------ - +''' class _WebSocketClientProtocol(WebSocketClientProtocol): def __init__(self, factory): self.factory = factory @@ -53,6 +65,7 @@ class _WebSocketClientFactory(WebSocketClientFactory): def buildProtocol(self, addr): return _WebSocketClientProtocol(self) +''' # ------ end twisted ------- class BaseWBClient(object): @@ -67,11 +80,13 @@ class BaseWBClient(object): self._send_queue = Queue.Queue() self._reactor_thread = None + self.session_factory = ApplicationSessionFactory() + def connect(self): - - log.msg("Connecting to 172.17.3.139:8282") - self.factory = _WampClientFactory( - "ws://172.17.3.139:8181", + + #log.msg("Connecting to 172.17.3.139:8181") + self.factory = _WampClientFactory(self.session_factory, + "ws://172.17.3.139:8181/ws", debug_wamp=True) self.factory.base_client = self @@ -85,19 +100,19 @@ class BaseWBClient(object): def send_message(self, body): if not self._check_connection(): return - log.msg("Queing send") + #log.msg("Queing send") self._send_queue.put(body) reactor.callFromThread(self._dispatch) def _check_connection(self): if not self._connected_event.wait(timeout=10): - log.err("Unable to connect to server") + #log.err("Unable to connect to server") self.close() return False return True def _dispatch(self): - log.msg("Dispatching") + #log.msg("Dispatching") while True: try: body = self._send_queue.get(block=False) @@ -121,8 +136,8 @@ if __name__ == '__main__': client = BaseWBClient(ws_setting) t1 = threading.Thread(client.connect()) - t11 = threading.Thread(Ppippo(client)) - t11.start() + #t11 = threading.Thread(Ppippo(client)) + #t11.start() t1.start() #client.connect() diff --git a/s4t-server-python/test_2.py b/s4t-server-python/test_autobahn_ws_client.py similarity index 98% rename from s4t-server-python/test_2.py rename to s4t-server-python/test_autobahn_ws_client.py index 918962e..508540d 100644 --- a/s4t-server-python/test_2.py +++ b/s4t-server-python/test_autobahn_ws_client.py @@ -46,7 +46,7 @@ class BaseWBClient(object): log.msg("Connecting to 172.17.3.139:8282") self.factory = _WebSocketClientFactory( - "ws://172.17.3.139:8181", + "ws://172.17.3.139:8282", debug=True) self.factory.base_client = self diff --git a/s4t-server-python/test_s.py b/s4t-server-python/test_autobahn_ws_server.py similarity index 100% rename from s4t-server-python/test_s.py rename to s4t-server-python/test_autobahn_ws_server.py diff --git a/s4t-server-python/test_c_W.py b/s4t-server-python/yooo.py similarity index 81% rename from s4t-server-python/test_c_W.py rename to s4t-server-python/yooo.py index 5903381..f9c504b 100644 --- a/s4t-server-python/test_c_W.py +++ b/s4t-server-python/yooo.py @@ -1,5 +1,5 @@ -from autobahn.twisted.websocket import WebSocketClientProtocol -from autobahn.twisted.websocket import WebSocketClientFactory +from autobahn.twisted.websocket import WampWebSocketClientProtocol +from autobahn.twisted.websocket import WampWebSocketClientFactory from autobahn.twisted.websocket import connectWS from twisted.internet import reactor @@ -11,7 +11,7 @@ import threading import Queue # ----- twisted ---------- -class _WebSocketClientProtocol(WebSocketClientProtocol): +class _WampWebSocketClientProtocol(WampWebSocketClientProtocol): def __init__(self, factory): self.factory = factory @@ -20,14 +20,14 @@ class _WebSocketClientProtocol(WebSocketClientProtocol): self.factory.protocol_instance = self self.factory.base_client._connected_event.set() -class _WebSocketClientFactory(WebSocketClientFactory): - def __init__(self, *args, **kwargs): - WebSocketClientFactory.__init__(self, *args, **kwargs) +class _WampWebSocketClientFactory(WampWebSocketClientFactory): + def __init__(self, factory, *args, **kwargs): + WampWebSocketClientFactory.__init__(self, factory, *args, **kwargs) self.protocol_instance = None self.base_client = None def buildProtocol(self, addr): - return _WebSocketClientProtocol(self) + return _WampWebSocketClientProtocol(self) # ------ end twisted ------- class BaseWBClient(object): @@ -46,7 +46,7 @@ class BaseWBClient(object): log.msg("Connecting to 172.17.3.139:8282") self.factory = _WebSocketClientFactory( - "ws://172.17.3.139:8181/ws", + "ws://172.17.3.139:8282", debug=True) self.factory.base_client = self @@ -96,12 +96,6 @@ if __name__ == '__main__': client = BaseWBClient(ws_setting) t1 = threading.Thread(client.connect()) - #t11 = threading.Thread(Ppippo(client)) - #t11.start() - t1.start() - - #client.connect() - #client.send_message('pippo') - - - \ No newline at end of file + t11 = threading.Thread(Ppippo(client)) + t11.start() + t1.start() \ No newline at end of file diff --git a/s4t-server-python/yos4t-wamp-server.py b/s4t-server-python/yos4t-wamp-server.py deleted file mode 100644 index 5aa21cc..0000000 --- a/s4t-server-python/yos4t-wamp-server.py +++ /dev/null @@ -1,125 +0,0 @@ -######################################################################################### -## -## The MIT License (MIT) -## -## Copyright (c) 2014 Andrea Rocco Lotronto -## -## Permission is hereby granted, free of charge, to any person obtaining a copy -## of this software and associated documentation files (the "Software"), to deal -## in the Software without restriction, including without limitation the rights -## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -## copies of the Software, and to permit persons to whom the Software is -## furnished to do so, subject to the following conditions: -## -## The above copyright notice and this permission notice shall be included in all -## copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -## SOFTWARE. -######################################################################################## - -from autobahn.twisted.wamp import ApplicationSession -from autobahn.twisted.wamp import ApplicationRunner -from twisted.internet.defer import inlineCallbacks - -from flask import Flask -from flask.ext import restful - -import threading -import multiprocessing - -urlWampRouter = "ws://ip:port/ws" -realmWampRouter = "s4t" -topic = 'board.connection' - -''' -class comevuoi_T(threading.Thread): - def __init__(self): - threading.Thread.__init__(self) - self.runner = ApplicationRunner(url = urlWampRouter, realm = realmWampRouter) - - def run(self): - self.runner.run(S4TWampServer) - -class serverRest(threading.Thread): - - class Wellcome(restful.Resource): - def get(self): - return{'Wellcome'} - - def __init__(self): - threading.Thread.__init__(self) - self.app = Flask(__name__) - self.api = restful.Api(self.app) - - - def run(self): - self.app.run(port=5566, debug=True) - -''' - -class serverRest(): - - class Wellcome(restful.Resource): - def get(self): - return{'Wellcome'} - - def __init__(self): - self.app = Flask(__name__) - self.api = restful.Api(self.app) - self.api.add_resource(self.Wellcome, '/') - - def avvio(self): - self.app.run(port=5566, debug=True) - - -class S4TWampServer(ApplicationSession): - - @inlineCallbacks - def onJoin(self, details): - - - self.connectedBoard = {} - - print("Connect to WAMP Router") - - def onMessage(*args): - print args - if args[1] == 'connection': - print(args[0]+ " connessa") - self.connectedBoard[args[0]] = args[0] - print self.connectedBoard - - if args[1] == 'disconnect': - print(args[0]+ " disconnessa") - del self.connectedBoard[args[0]] - print self.connectedBoard - - - try: - yield self.subscribe(onMessage, topic) - print ("subscribed to topic:: "+topic) - except Exception as e: - print("could not subscribe to topic: {0}".format(e)) - - - -x = serverRest() - -def worker(): - """worker function""" - x.avvio() - - -if __name__ == '__main__': - #rest = multiprocessing.Process(target=worker) - - #rest.start() - runner = ApplicationRunner(url = urlWampRouter, realm = realmWampRouter) - runner.run(S4TWampServer) - print ("Prova")