├── .gitignore ├── README.md ├── SocketIO.php ├── composer.json ├── composer.phar └── test ├── client.php ├── node_modules ├── accepts │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── after │ ├── .npmignore │ ├── .travis.yml │ ├── LICENCE │ ├── README.md │ ├── index.js │ ├── package.json │ └── test │ │ └── after-test.js ├── arraybuffer.slice │ ├── .npmignore │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test │ │ └── slice-buffer.js ├── backo2 │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ ├── package.json │ └── test │ │ └── index.js ├── base64-arraybuffer │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE-MIT │ ├── README.md │ ├── lib │ │ └── base64-arraybuffer.js │ └── package.json ├── base64id │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── lib │ │ └── base64id.js │ └── package.json ├── better-assert │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── example.js │ ├── index.js │ └── package.json ├── blob │ ├── .npmignore │ ├── .zuul.yml │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test │ │ └── index.js ├── callsite │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── index.js │ └── package.json ├── component-bind │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ └── package.json ├── component-emitter │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── index.js │ └── package.json ├── component-inherit │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ ├── package.json │ └── test │ │ └── inherit.js ├── cookie │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── debug │ ├── .coveralls.yml │ ├── .eslintrc │ ├── .npmignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── component.json │ ├── karma.conf.js │ ├── node.js │ ├── package.json │ └── src │ │ ├── browser.js │ │ ├── debug.js │ │ ├── index.js │ │ └── node.js ├── engine.io-client │ ├── History.md │ ├── LICENSE │ ├── README.md │ ├── engine.io.js │ ├── index.js │ ├── lib │ │ ├── index.js │ │ ├── socket.js │ │ ├── transport.js │ │ ├── transports │ │ │ ├── index.js │ │ │ ├── polling-jsonp.js │ │ │ ├── polling-xhr.js │ │ │ ├── polling.js │ │ │ └── websocket.js │ │ └── xmlhttprequest.js │ └── package.json ├── engine.io-parser │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── index.js │ ├── lib │ │ ├── browser.js │ │ ├── index.js │ │ ├── keys.js │ │ └── utf8.js │ └── package.json ├── engine.io │ ├── History.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── engine.io.js │ │ ├── server.js │ │ ├── socket.js │ │ ├── transport.js │ │ └── transports │ │ │ ├── index.js │ │ │ ├── polling-jsonp.js │ │ │ ├── polling-xhr.js │ │ │ ├── polling.js │ │ │ └── websocket.js │ └── package.json ├── has-binary2 │ ├── History.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── has-cors │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ ├── package.json │ └── test.js ├── indexof │ ├── .npmignore │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ └── package.json ├── isarray │ ├── README.md │ ├── index.js │ └── package.json ├── mime-db │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── db.json │ ├── index.js │ └── package.json ├── mime-types │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── ms │ ├── index.js │ ├── license.md │ ├── package.json │ └── readme.md ├── negotiator │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── charset.js │ │ ├── encoding.js │ │ ├── language.js │ │ └── mediaType.js │ └── package.json ├── object-assign │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── object-component │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── component.json │ ├── index.js │ ├── package.json │ └── test │ │ └── object.js ├── parsejson │ ├── .npmignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── parseqs │ ├── .npmignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── parseuri │ ├── .npmignore │ ├── History.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── safe-buffer │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── browser.js │ ├── index.js │ ├── package.json │ └── test.js ├── socket.io-adapter │ ├── .npmignore │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── index.js │ ├── node_modules │ │ ├── debug │ │ │ ├── .jshintrc │ │ │ ├── .npmignore │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── bower.json │ │ │ ├── browser.js │ │ │ ├── component.json │ │ │ ├── debug.js │ │ │ ├── index.js │ │ │ ├── node.js │ │ │ └── package.json │ │ └── ms │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ └── package.json ├── socket.io-client │ ├── History.md │ ├── LICENSE │ ├── README.md │ ├── dist │ │ ├── socket.io.js │ │ ├── socket.io.js.map │ │ ├── socket.io.slim.js │ │ └── socket.io.slim.js.map │ ├── lib │ │ ├── index.js │ │ ├── manager.js │ │ ├── on.js │ │ ├── socket.js │ │ └── url.js │ └── package.json ├── socket.io-parser │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── binary.js │ ├── index.js │ ├── is-buffer.js │ └── package.json ├── socket.io │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── lib │ │ ├── client.js │ │ ├── index.js │ │ ├── namespace.js │ │ └── socket.js │ └── package.json ├── to-array │ ├── .npmignore │ ├── LICENCE │ ├── README.md │ ├── index.js │ └── package.json ├── ultron │ ├── LICENSE │ ├── index.js │ └── package.json ├── uws │ ├── LICENSE │ ├── README.md │ ├── binding.gyp │ ├── build │ │ ├── Makefile │ │ ├── Release │ │ │ ├── .deps │ │ │ │ ├── Release │ │ │ │ │ ├── obj.target │ │ │ │ │ │ ├── action_after_build.stamp.d │ │ │ │ │ │ └── uws │ │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── Extensions.o.d │ │ │ │ │ │ │ ├── Group.o.d │ │ │ │ │ │ │ ├── HTTPSocket.o.d │ │ │ │ │ │ │ ├── Hub.o.d │ │ │ │ │ │ │ ├── Networking.o.d │ │ │ │ │ │ │ ├── Node.o.d │ │ │ │ │ │ │ ├── Socket.o.d │ │ │ │ │ │ │ ├── WebSocket.o.d │ │ │ │ │ │ │ └── addon.o.d │ │ │ │ │ └── uws.node.d │ │ │ │ └── uws.d │ │ │ ├── obj.target │ │ │ │ ├── action_after_build.stamp │ │ │ │ └── uws │ │ │ │ │ └── src │ │ │ │ │ ├── Extensions.o │ │ │ │ │ ├── Group.o │ │ │ │ │ ├── HTTPSocket.o │ │ │ │ │ ├── Hub.o │ │ │ │ │ ├── Networking.o │ │ │ │ │ ├── Node.o │ │ │ │ │ ├── Socket.o │ │ │ │ │ ├── WebSocket.o │ │ │ │ │ └── addon.o │ │ │ └── uws.node │ │ ├── action_after_build.target.mk │ │ ├── binding.Makefile │ │ ├── config.gypi │ │ ├── gyp-mac-tool │ │ └── uws.target.mk │ ├── build_log.txt │ ├── package.json │ ├── src │ │ ├── Asio.h │ │ ├── Backend.h │ │ ├── Epoll.cpp │ │ ├── Epoll.h │ │ ├── Extensions.cpp │ │ ├── Extensions.h │ │ ├── Group.cpp │ │ ├── Group.h │ │ ├── HTTPSocket.cpp │ │ ├── HTTPSocket.h │ │ ├── Hub.cpp │ │ ├── Hub.h │ │ ├── Libuv.h │ │ ├── Networking.cpp │ │ ├── Networking.h │ │ ├── Node.cpp │ │ ├── Node.h │ │ ├── Socket.cpp │ │ ├── Socket.h │ │ ├── WebSocket.cpp │ │ ├── WebSocket.h │ │ ├── WebSocketProtocol.h │ │ ├── addon.cpp │ │ ├── addon.h │ │ ├── http.h │ │ └── uWS.h │ ├── uws.js │ ├── uws_darwin_46.node │ ├── uws_darwin_47.node │ ├── uws_darwin_48.node │ ├── uws_darwin_51.node │ ├── uws_linux_46.node │ ├── uws_linux_47.node │ ├── uws_linux_48.node │ ├── uws_linux_51.node │ ├── uws_win32_48.node │ └── uws_win32_51.node ├── ws │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── BufferUtil.js │ │ ├── Constants.js │ │ ├── ErrorCodes.js │ │ ├── EventTarget.js │ │ ├── Extensions.js │ │ ├── PerMessageDeflate.js │ │ ├── Receiver.js │ │ ├── Sender.js │ │ ├── Validation.js │ │ ├── WebSocket.js │ │ └── WebSocketServer.js │ └── package.json ├── xmlhttprequest-ssl │ ├── LICENSE │ ├── README.md │ ├── autotest.watchr │ ├── example │ │ └── demo.js │ ├── lib │ │ └── XMLHttpRequest.js │ ├── package.json │ └── tests │ │ ├── test-constants.js │ │ ├── test-events.js │ │ ├── test-exceptions.js │ │ ├── test-headers.js │ │ ├── test-redirect-302.js │ │ ├── test-redirect-303.js │ │ ├── test-redirect-307.js │ │ ├── test-request-methods.js │ │ ├── test-request-protocols.js │ │ └── testdata.txt └── yeast │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json └── socket-server.js /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PHP Socket Client 2 | =================== 3 | 4 | Fork from : ```https://github.com/psinetron/PHP_SocketIO_Client``` 5 | 6 | 7 | ***install*** 8 | 9 | 10 | ``` 11 | php composer require touskar/php-socket-io-event-emitter 12 | ``` 13 | 14 | 15 | ***Php*** 16 | ```php 17 | 18 | require_once '../SocketIO.php'; 19 | 20 | $client = new SocketIO('localhost', 9001); 21 | 22 | //connection handshake query( for auth - optional) 23 | $client->setQueryParams([ 24 | 'token' => 'edihsudshuz', 25 | 'id' => '8780', 26 | 'cid' => '344', 27 | 'cmp' => 2339 28 | ]); 29 | 30 | $success = $client->emit('eventFromPhp', [ 31 | 'name' => 'Goku', 32 | 'age' => '23', 33 | 'address' => 'Sudbury, On, Canada' 34 | ]); 35 | 36 | if(!$success) 37 | { 38 | var_dump($client->getErrors()); 39 | } 40 | else{ 41 | var_dump("Success"); 42 | } 43 | 44 | ``` 45 | 46 | ***Node Js*** 47 | 48 | 49 | ```js 50 | 51 | var app = require('http').createServer(handler) 52 | var io = require('socket.io')(app); 53 | var fs = require('fs'); 54 | 55 | app.listen(9001); 56 | 57 | function handler (req, res) { 58 | res.writeHead(200); 59 | res.end('Hello Word'); 60 | } 61 | 62 | 63 | io.on('connection', function (socket) { 64 | 65 | console.log("New Connection with transport", socket.conn.transport.name); 66 | 67 | console.log('With handshake', socket.handshake); 68 | 69 | 70 | console.log('With query', socket.handshake.query); 71 | 72 | socket.on('eventFromPhp', function (data) { 73 | console.log('Data from Php', data, JSON.parse(data)); 74 | }); 75 | }); 76 | 77 | ``` 78 | 79 | **2 - API** 80 | ------------- 81 | ***.```setMaxRetry(n)```*** 82 | ``` 83 | $client->setMaxRetry(10);//default 5 84 | ``` 85 | 86 | ***.```setRetryInterval(interval)```*** 87 | ``` 88 | $client->setRetryInterval(100);// 100 ms, default 200 89 | ``` 90 | 91 | 92 | ***.```setProtocole(protocol)```*** 93 | ``` 94 | $client->setProtocole(SocketIO::NO_SECURE_PROTOCOLE); 95 | $client->setProtocole(SocketIO::TLS_PROTOCOLE); 96 | $client->setProtocole(SocketIO::SSL_PROTOCOLE); 97 | ``` 98 | 99 | ***.```setPort(port)```*** 100 | ``` 101 | $client->setPort(80); 102 | ``` 103 | 104 | ***.```setPath(path)```*** 105 | ``` 106 | $client->setPath('/socket.io/EIO=3'); 107 | ``` 108 | 109 | ***.```setHost(host)```*** 110 | ``` 111 | $client->setPath('localhost'); 112 | ``` 113 | 114 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "touskar/php-socket-io-event-emitter", 3 | "authors": [ 4 | { 5 | "name": "Moussa Ndour", 6 | "email": "moussa_ndour@hotmail.fr" 7 | } 8 | ], 9 | "require": {} 10 | } 11 | -------------------------------------------------------------------------------- /composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/composer.phar -------------------------------------------------------------------------------- /test/client.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | setQueryParams([ 19 | 'token' => 'edihsudshuz', 20 | 'id' => '8780', 21 | 'cid' => '344', 22 | 'cmp' => 2339 23 | ]); 24 | 25 | $success = $client->emit('eventFromPhp', [ 26 | 'name' => 'Goku', 27 | 'age' => '23', 28 | 'address' => 'Sudbury, On, Canada' 29 | ]); 30 | 31 | if(!$success) 32 | { 33 | var_dump($client->getErrors()); 34 | } 35 | else{ 36 | var_dump("Success"); 37 | } 38 | -------------------------------------------------------------------------------- /test/node_modules/accepts/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Jonathan Ong 4 | Copyright (c) 2015 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /test/node_modules/after/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .monitor 3 | -------------------------------------------------------------------------------- /test/node_modules/after/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | - 0.9 6 | - 0.10 7 | - 0.12 8 | - 4.2.4 9 | - 5.4.1 10 | - iojs-1 11 | - iojs-2 12 | - iojs-3 13 | -------------------------------------------------------------------------------- /test/node_modules/after/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Raynos. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /test/node_modules/after/index.js: -------------------------------------------------------------------------------- 1 | module.exports = after 2 | 3 | function after(count, callback, err_cb) { 4 | var bail = false 5 | err_cb = err_cb || noop 6 | proxy.count = count 7 | 8 | return (count === 0) ? callback() : proxy 9 | 10 | function proxy(err, result) { 11 | if (proxy.count <= 0) { 12 | throw new Error('after called too many times') 13 | } 14 | --proxy.count 15 | 16 | // after first error, rest are passed to err_cb 17 | if (err) { 18 | bail = true 19 | callback(err) 20 | // future error callbacks will go to error handler 21 | callback = err_cb 22 | } else if (proxy.count === 0 && !bail) { 23 | callback(null, result) 24 | } 25 | } 26 | } 27 | 28 | function noop() {} 29 | -------------------------------------------------------------------------------- /test/node_modules/arraybuffer.slice/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | lcov.info 3 | *.seed 4 | *.log 5 | *.csv 6 | *.dat 7 | *.out 8 | *.pid 9 | *.gz 10 | 11 | pids 12 | logs 13 | results 14 | build 15 | .grunt 16 | 17 | node_modules 18 | -------------------------------------------------------------------------------- /test/node_modules/arraybuffer.slice/Makefile: -------------------------------------------------------------------------------- 1 | 2 | REPORTER = dot 3 | 4 | test: 5 | @./node_modules/.bin/mocha \ 6 | --reporter $(REPORTER) 7 | 8 | .PHONY: test 9 | -------------------------------------------------------------------------------- /test/node_modules/arraybuffer.slice/README.md: -------------------------------------------------------------------------------- 1 | # How to 2 | ```javascript 3 | var sliceBuffer = require('arraybuffer.slice'); 4 | var ab = (new Int8Array(5)).buffer; 5 | var sliced = sliceBuffer(ab, 1, 3); 6 | sliced = sliceBuffer(ab, 1); 7 | ``` 8 | 9 | # Licence (MIT) 10 | Copyright (C) 2013 Rase- 11 | 12 | 13 | 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: 14 | 15 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 16 | 17 | 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. 18 | -------------------------------------------------------------------------------- /test/node_modules/arraybuffer.slice/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An abstraction for slicing an arraybuffer even when 3 | * ArrayBuffer.prototype.slice is not supported 4 | * 5 | * @api public 6 | */ 7 | 8 | module.exports = function(arraybuffer, start, end) { 9 | var bytes = arraybuffer.byteLength; 10 | start = start || 0; 11 | end = end || bytes; 12 | 13 | if (arraybuffer.slice) { return arraybuffer.slice(start, end); } 14 | 15 | if (start < 0) { start += bytes; } 16 | if (end < 0) { end += bytes; } 17 | if (end > bytes) { end = bytes; } 18 | 19 | if (start >= bytes || start >= end || bytes === 0) { 20 | return new ArrayBuffer(0); 21 | } 22 | 23 | var abv = new Uint8Array(arraybuffer); 24 | var result = new Uint8Array(end - start); 25 | for (var i = start, ii = 0; i < end; i++, ii++) { 26 | result[ii] = abv[i]; 27 | } 28 | return result.buffer; 29 | }; 30 | -------------------------------------------------------------------------------- /test/node_modules/arraybuffer.slice/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "arraybuffer.slice@0.0.6", 6 | "scope": null, 7 | "escapedName": "arraybuffer.slice", 8 | "name": "arraybuffer.slice", 9 | "rawSpec": "0.0.6", 10 | "spec": "0.0.6", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-parser" 14 | ] 15 | ], 16 | "_from": "arraybuffer.slice@0.0.6", 17 | "_id": "arraybuffer.slice@0.0.6", 18 | "_inCache": true, 19 | "_location": "/arraybuffer.slice", 20 | "_npmUser": { 21 | "name": "rase-", 22 | "email": "tonykovanen@hotmail.com" 23 | }, 24 | "_npmVersion": "1.3.5", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "arraybuffer.slice@0.0.6", 28 | "scope": null, 29 | "escapedName": "arraybuffer.slice", 30 | "name": "arraybuffer.slice", 31 | "rawSpec": "0.0.6", 32 | "spec": "0.0.6", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/engine.io-parser" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", 39 | "_shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca", 40 | "_shrinkwrap": null, 41 | "_spec": "arraybuffer.slice@0.0.6", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-parser", 43 | "bugs": { 44 | "url": "https://github.com/rase-/arraybuffer.slice/issues" 45 | }, 46 | "dependencies": {}, 47 | "description": "Exports a function for slicing ArrayBuffers (no polyfilling)", 48 | "devDependencies": { 49 | "expect.js": "0.2.0", 50 | "mocha": "1.17.1" 51 | }, 52 | "directories": {}, 53 | "dist": { 54 | "shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca", 55 | "tarball": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz" 56 | }, 57 | "homepage": "https://github.com/rase-/arraybuffer.slice", 58 | "maintainers": [ 59 | { 60 | "name": "rase-", 61 | "email": "tonykovanen@hotmail.com" 62 | } 63 | ], 64 | "name": "arraybuffer.slice", 65 | "optionalDependencies": {}, 66 | "readme": "ERROR: No README data found!", 67 | "repository": { 68 | "type": "git", 69 | "url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git" 70 | }, 71 | "version": "0.0.6" 72 | } 73 | -------------------------------------------------------------------------------- /test/node_modules/backo2/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /test/node_modules/backo2/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.1 / 2014-02-17 3 | ================== 4 | 5 | * go away decimal point 6 | * history 7 | 8 | 1.0.0 / 2014-02-17 9 | ================== 10 | 11 | * add jitter option 12 | * Initial commit 13 | -------------------------------------------------------------------------------- /test/node_modules/backo2/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter dot \ 6 | --bail 7 | 8 | .PHONY: test -------------------------------------------------------------------------------- /test/node_modules/backo2/Readme.md: -------------------------------------------------------------------------------- 1 | # backo 2 | 3 | Simple exponential backoff because the others seem to have weird abstractions. 4 | 5 | ## Installation 6 | 7 | ``` 8 | $ npm install backo 9 | ``` 10 | 11 | ## Options 12 | 13 | - `min` initial timeout in milliseconds [100] 14 | - `max` max timeout [10000] 15 | - `jitter` [0] 16 | - `factor` [2] 17 | 18 | ## Example 19 | 20 | ```js 21 | var Backoff = require('backo'); 22 | var backoff = new Backoff({ min: 100, max: 20000 }); 23 | 24 | setTimeout(function(){ 25 | something.reconnect(); 26 | }, backoff.duration()); 27 | 28 | // later when something works 29 | backoff.reset() 30 | ``` 31 | 32 | # License 33 | 34 | MIT 35 | -------------------------------------------------------------------------------- /test/node_modules/backo2/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backo", 3 | "repo": "segmentio/backo", 4 | "dependencies": {}, 5 | "version": "1.0.1", 6 | "description": "simple backoff without the weird abstractions", 7 | "keywords": ["backoff"], 8 | "license": "MIT", 9 | "scripts": ["index.js"], 10 | "main": "index.js" 11 | } 12 | -------------------------------------------------------------------------------- /test/node_modules/backo2/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `Backoff`. 4 | */ 5 | 6 | module.exports = Backoff; 7 | 8 | /** 9 | * Initialize backoff timer with `opts`. 10 | * 11 | * - `min` initial timeout in milliseconds [100] 12 | * - `max` max timeout [10000] 13 | * - `jitter` [0] 14 | * - `factor` [2] 15 | * 16 | * @param {Object} opts 17 | * @api public 18 | */ 19 | 20 | function Backoff(opts) { 21 | opts = opts || {}; 22 | this.ms = opts.min || 100; 23 | this.max = opts.max || 10000; 24 | this.factor = opts.factor || 2; 25 | this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0; 26 | this.attempts = 0; 27 | } 28 | 29 | /** 30 | * Return the backoff duration. 31 | * 32 | * @return {Number} 33 | * @api public 34 | */ 35 | 36 | Backoff.prototype.duration = function(){ 37 | var ms = this.ms * Math.pow(this.factor, this.attempts++); 38 | if (this.jitter) { 39 | var rand = Math.random(); 40 | var deviation = Math.floor(rand * this.jitter * ms); 41 | ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation; 42 | } 43 | return Math.min(ms, this.max) | 0; 44 | }; 45 | 46 | /** 47 | * Reset the number of attempts. 48 | * 49 | * @api public 50 | */ 51 | 52 | Backoff.prototype.reset = function(){ 53 | this.attempts = 0; 54 | }; 55 | 56 | /** 57 | * Set the minimum duration 58 | * 59 | * @api public 60 | */ 61 | 62 | Backoff.prototype.setMin = function(min){ 63 | this.ms = min; 64 | }; 65 | 66 | /** 67 | * Set the maximum duration 68 | * 69 | * @api public 70 | */ 71 | 72 | Backoff.prototype.setMax = function(max){ 73 | this.max = max; 74 | }; 75 | 76 | /** 77 | * Set the jitter 78 | * 79 | * @api public 80 | */ 81 | 82 | Backoff.prototype.setJitter = function(jitter){ 83 | this.jitter = jitter; 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /test/node_modules/backo2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "backo2@1.0.2", 6 | "scope": null, 7 | "escapedName": "backo2", 8 | "name": "backo2", 9 | "rawSpec": "1.0.2", 10 | "spec": "1.0.2", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "backo2@1.0.2", 17 | "_id": "backo2@1.0.2", 18 | "_inCache": true, 19 | "_location": "/backo2", 20 | "_npmUser": { 21 | "name": "mokesmokes", 22 | "email": "mokesmokes@gmail.com" 23 | }, 24 | "_npmVersion": "1.4.28", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "backo2@1.0.2", 28 | "scope": null, 29 | "escapedName": "backo2", 30 | "name": "backo2", 31 | "rawSpec": "1.0.2", 32 | "spec": "1.0.2", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/socket.io-client" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", 39 | "_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947", 40 | "_shrinkwrap": null, 41 | "_spec": "backo2@1.0.2", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 43 | "bugs": { 44 | "url": "https://github.com/mokesmokes/backo/issues" 45 | }, 46 | "dependencies": {}, 47 | "description": "simple backoff based on segmentio/backo", 48 | "devDependencies": { 49 | "mocha": "*", 50 | "should": "*" 51 | }, 52 | "directories": {}, 53 | "dist": { 54 | "shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947", 55 | "tarball": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz" 56 | }, 57 | "gitHead": "3e695bade7756fef2295e8883bf3570a06e5d9ec", 58 | "homepage": "https://github.com/mokesmokes/backo", 59 | "keywords": [ 60 | "backoff" 61 | ], 62 | "license": "MIT", 63 | "maintainers": [ 64 | { 65 | "name": "mokesmokes", 66 | "email": "mokesmokes@gmail.com" 67 | } 68 | ], 69 | "name": "backo2", 70 | "optionalDependencies": {}, 71 | "readme": "ERROR: No README data found!", 72 | "repository": { 73 | "type": "git", 74 | "url": "git+https://github.com/mokesmokes/backo.git" 75 | }, 76 | "scripts": {}, 77 | "version": "1.0.2" 78 | } 79 | -------------------------------------------------------------------------------- /test/node_modules/backo2/test/index.js: -------------------------------------------------------------------------------- 1 | 2 | var Backoff = require('..'); 3 | var assert = require('assert'); 4 | 5 | describe('.duration()', function(){ 6 | it('should increase the backoff', function(){ 7 | var b = new Backoff; 8 | 9 | assert(100 == b.duration()); 10 | assert(200 == b.duration()); 11 | assert(400 == b.duration()); 12 | assert(800 == b.duration()); 13 | 14 | b.reset(); 15 | assert(100 == b.duration()); 16 | assert(200 == b.duration()); 17 | }) 18 | }) -------------------------------------------------------------------------------- /test/node_modules/base64-arraybuffer/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | Gruntfile.js 3 | /test/ 4 | -------------------------------------------------------------------------------- /test/node_modules/base64-arraybuffer/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.12' 4 | - iojs-1 5 | - iojs-2 6 | - iojs-3 7 | - '4.1' 8 | before_script: 9 | - npm install 10 | before_install: npm install -g npm@'>=2.13.5' 11 | deploy: 12 | provider: npm 13 | email: niklasvh@gmail.com 14 | api_key: 15 | secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo= 16 | on: 17 | tags: true 18 | branch: master 19 | repo: niklasvh/base64-arraybuffer 20 | -------------------------------------------------------------------------------- /test/node_modules/base64-arraybuffer/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Niklas von Hertzen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/base64-arraybuffer/README.md: -------------------------------------------------------------------------------- 1 | # base64-arraybuffer 2 | 3 | [![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) 5 | [![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) 6 | 7 | Encode/decode base64 data into ArrayBuffers 8 | 9 | ## Getting Started 10 | Install the module with: `npm install base64-arraybuffer` 11 | 12 | ## API 13 | The library encodes and decodes base64 to and from ArrayBuffers 14 | 15 | - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string 16 | - __decode(str)__ - Decodes base64 string to `ArrayBuffer` 17 | 18 | ## License 19 | Copyright (c) 2012 Niklas von Hertzen 20 | Licensed under the MIT license. 21 | -------------------------------------------------------------------------------- /test/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * base64-arraybuffer 3 | * https://github.com/niklasvh/base64-arraybuffer 4 | * 5 | * Copyright (c) 2012 Niklas von Hertzen 6 | * Licensed under the MIT license. 7 | */ 8 | (function(){ 9 | "use strict"; 10 | 11 | var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 12 | 13 | // Use a lookup table to find the index. 14 | var lookup = new Uint8Array(256); 15 | for (var i = 0; i < chars.length; i++) { 16 | lookup[chars.charCodeAt(i)] = i; 17 | } 18 | 19 | exports.encode = function(arraybuffer) { 20 | var bytes = new Uint8Array(arraybuffer), 21 | i, len = bytes.length, base64 = ""; 22 | 23 | for (i = 0; i < len; i+=3) { 24 | base64 += chars[bytes[i] >> 2]; 25 | base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; 26 | base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; 27 | base64 += chars[bytes[i + 2] & 63]; 28 | } 29 | 30 | if ((len % 3) === 2) { 31 | base64 = base64.substring(0, base64.length - 1) + "="; 32 | } else if (len % 3 === 1) { 33 | base64 = base64.substring(0, base64.length - 2) + "=="; 34 | } 35 | 36 | return base64; 37 | }; 38 | 39 | exports.decode = function(base64) { 40 | var bufferLength = base64.length * 0.75, 41 | len = base64.length, i, p = 0, 42 | encoded1, encoded2, encoded3, encoded4; 43 | 44 | if (base64[base64.length - 1] === "=") { 45 | bufferLength--; 46 | if (base64[base64.length - 2] === "=") { 47 | bufferLength--; 48 | } 49 | } 50 | 51 | var arraybuffer = new ArrayBuffer(bufferLength), 52 | bytes = new Uint8Array(arraybuffer); 53 | 54 | for (i = 0; i < len; i+=4) { 55 | encoded1 = lookup[base64.charCodeAt(i)]; 56 | encoded2 = lookup[base64.charCodeAt(i+1)]; 57 | encoded3 = lookup[base64.charCodeAt(i+2)]; 58 | encoded4 = lookup[base64.charCodeAt(i+3)]; 59 | 60 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); 61 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); 62 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); 63 | } 64 | 65 | return arraybuffer; 66 | }; 67 | })(); 68 | -------------------------------------------------------------------------------- /test/node_modules/base64id/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | -------------------------------------------------------------------------------- /test/node_modules/base64id/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012-2016 Kristian Faeldt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/base64id/README.md: -------------------------------------------------------------------------------- 1 | base64id 2 | ======== 3 | 4 | Node.js module that generates a base64 id. 5 | 6 | Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4. 7 | 8 | To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes. 9 | 10 | ## Installation 11 | 12 | $ npm install base64id 13 | 14 | ## Usage 15 | 16 | var base64id = require('base64id'); 17 | 18 | var id = base64id.generateId(); 19 | -------------------------------------------------------------------------------- /test/node_modules/better-assert/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /test/node_modules/better-assert/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.0 / 2013-02-03 3 | ================== 4 | 5 | * Stop using the removed magic __stack global getter 6 | 7 | 0.1.0 / 2012-10-04 8 | ================== 9 | 10 | * add throwing of AssertionError for test frameworks etc 11 | 12 | 0.0.1 / 2010-01-03 13 | ================== 14 | 15 | * Initial release 16 | -------------------------------------------------------------------------------- /test/node_modules/better-assert/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @echo "populate me" 4 | 5 | .PHONY: test -------------------------------------------------------------------------------- /test/node_modules/better-assert/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # better-assert 3 | 4 | Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for 5 | self-documenting failure messages. 6 | 7 | ## Installation 8 | 9 | $ npm install better-assert 10 | 11 | ## Example 12 | 13 | By default assertions are enabled, however the __NO_ASSERT__ environment variable 14 | will deactivate them when truthy. 15 | 16 | ```js 17 | var assert = require('better-assert'); 18 | 19 | test(); 20 | 21 | function test() { 22 | var user = { name: 'tobi' }; 23 | assert('tobi' == user.name); 24 | assert('number' == typeof user.age); 25 | } 26 | 27 | AssertionError: 'number' == typeof user.age 28 | at test (/Users/tj/projects/better-assert/example.js:9:3) 29 | at Object. (/Users/tj/projects/better-assert/example.js:4:1) 30 | at Module._compile (module.js:449:26) 31 | at Object.Module._extensions..js (module.js:467:10) 32 | at Module.load (module.js:356:32) 33 | at Function.Module._load (module.js:312:12) 34 | at Module.runMain (module.js:492:10) 35 | at process.startup.processNextTick.process._tickCallback (node.js:244:9) 36 | ``` 37 | 38 | ## License 39 | 40 | (The MIT License) 41 | 42 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining 45 | a copy of this software and associated documentation files (the 46 | 'Software'), to deal in the Software without restriction, including 47 | without limitation the rights to use, copy, modify, merge, publish, 48 | distribute, sublicense, and/or sell copies of the Software, and to 49 | permit persons to whom the Software is furnished to do so, subject to 50 | the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be 53 | included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 58 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 59 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 60 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 61 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/node_modules/better-assert/example.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('./'); 3 | 4 | test(); 5 | 6 | function test() { 7 | var user = { name: 'tobi' }; 8 | assert('tobi' == user.name); 9 | assert('number' == typeof user.age); 10 | } -------------------------------------------------------------------------------- /test/node_modules/better-assert/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var AssertionError = require('assert').AssertionError 6 | , callsite = require('callsite') 7 | , fs = require('fs') 8 | 9 | /** 10 | * Expose `assert`. 11 | */ 12 | 13 | module.exports = process.env.NO_ASSERT 14 | ? function(){} 15 | : assert; 16 | 17 | /** 18 | * Assert the given `expr`. 19 | */ 20 | 21 | function assert(expr) { 22 | if (expr) return; 23 | 24 | var stack = callsite(); 25 | var call = stack[1]; 26 | var file = call.getFileName(); 27 | var lineno = call.getLineNumber(); 28 | var src = fs.readFileSync(file, 'utf8'); 29 | var line = src.split('\n')[lineno-1]; 30 | var src = line.match(/assert\((.*)\)/)[1]; 31 | 32 | var err = new AssertionError({ 33 | message: src, 34 | stackStartFunction: stack[0].getFunction() 35 | }); 36 | 37 | throw err; 38 | } 39 | -------------------------------------------------------------------------------- /test/node_modules/blob/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | blob.js 3 | -------------------------------------------------------------------------------- /test/node_modules/blob/.zuul.yml: -------------------------------------------------------------------------------- 1 | ui: mocha-bdd 2 | browsers: 3 | - name: chrome 4 | version: 8..latest 5 | - name: firefox 6 | version: 7..latest 7 | - name: safari 8 | version: 6..latest 9 | - name: opera 10 | version: 12.1..latest 11 | - name: ie 12 | version: 10..latest 13 | - name: android 14 | version: latest 15 | -------------------------------------------------------------------------------- /test/node_modules/blob/Makefile: -------------------------------------------------------------------------------- 1 | REPORTER = dot 2 | 3 | build: blob.js 4 | 5 | blob.js: 6 | @./node_modules/.bin/browserify --standalone blob index.js > blob.js 7 | 8 | test: 9 | @./node_modules/.bin/zuul -- test/index.js 10 | 11 | clean: 12 | rm blob.js 13 | 14 | .PHONY: test blob.js 15 | -------------------------------------------------------------------------------- /test/node_modules/blob/README.md: -------------------------------------------------------------------------------- 1 | Blob 2 | ==== 3 | 4 | A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined. 5 | 6 | Usage: 7 | 8 | ```javascript 9 | var Blob = require('blob'); 10 | var b = new Blob(['hi', 'constructing', 'a', 'blob']); 11 | ``` 12 | 13 | ## Licence 14 | MIT 15 | -------------------------------------------------------------------------------- /test/node_modules/blob/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Create a blob builder even when vendor prefixes exist 3 | */ 4 | 5 | var BlobBuilder = global.BlobBuilder 6 | || global.WebKitBlobBuilder 7 | || global.MSBlobBuilder 8 | || global.MozBlobBuilder; 9 | 10 | /** 11 | * Check if Blob constructor is supported 12 | */ 13 | 14 | var blobSupported = (function() { 15 | try { 16 | var a = new Blob(['hi']); 17 | return a.size === 2; 18 | } catch(e) { 19 | return false; 20 | } 21 | })(); 22 | 23 | /** 24 | * Check if Blob constructor supports ArrayBufferViews 25 | * Fails in Safari 6, so we need to map to ArrayBuffers there. 26 | */ 27 | 28 | var blobSupportsArrayBufferView = blobSupported && (function() { 29 | try { 30 | var b = new Blob([new Uint8Array([1,2])]); 31 | return b.size === 2; 32 | } catch(e) { 33 | return false; 34 | } 35 | })(); 36 | 37 | /** 38 | * Check if BlobBuilder is supported 39 | */ 40 | 41 | var blobBuilderSupported = BlobBuilder 42 | && BlobBuilder.prototype.append 43 | && BlobBuilder.prototype.getBlob; 44 | 45 | /** 46 | * Helper function that maps ArrayBufferViews to ArrayBuffers 47 | * Used by BlobBuilder constructor and old browsers that didn't 48 | * support it in the Blob constructor. 49 | */ 50 | 51 | function mapArrayBufferViews(ary) { 52 | for (var i = 0; i < ary.length; i++) { 53 | var chunk = ary[i]; 54 | if (chunk.buffer instanceof ArrayBuffer) { 55 | var buf = chunk.buffer; 56 | 57 | // if this is a subarray, make a copy so we only 58 | // include the subarray region from the underlying buffer 59 | if (chunk.byteLength !== buf.byteLength) { 60 | var copy = new Uint8Array(chunk.byteLength); 61 | copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); 62 | buf = copy.buffer; 63 | } 64 | 65 | ary[i] = buf; 66 | } 67 | } 68 | } 69 | 70 | function BlobBuilderConstructor(ary, options) { 71 | options = options || {}; 72 | 73 | var bb = new BlobBuilder(); 74 | mapArrayBufferViews(ary); 75 | 76 | for (var i = 0; i < ary.length; i++) { 77 | bb.append(ary[i]); 78 | } 79 | 80 | return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); 81 | }; 82 | 83 | function BlobConstructor(ary, options) { 84 | mapArrayBufferViews(ary); 85 | return new Blob(ary, options || {}); 86 | }; 87 | 88 | module.exports = (function() { 89 | if (blobSupported) { 90 | return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; 91 | } else if (blobBuilderSupported) { 92 | return BlobBuilderConstructor; 93 | } else { 94 | return undefined; 95 | } 96 | })(); 97 | -------------------------------------------------------------------------------- /test/node_modules/blob/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "blob@0.0.4", 6 | "scope": null, 7 | "escapedName": "blob", 8 | "name": "blob", 9 | "rawSpec": "0.0.4", 10 | "spec": "0.0.4", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-parser" 14 | ] 15 | ], 16 | "_from": "blob@0.0.4", 17 | "_id": "blob@0.0.4", 18 | "_inCache": true, 19 | "_location": "/blob", 20 | "_npmUser": { 21 | "name": "rase-", 22 | "email": "tonykovanen@hotmail.com" 23 | }, 24 | "_npmVersion": "1.4.6", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "blob@0.0.4", 28 | "scope": null, 29 | "escapedName": "blob", 30 | "name": "blob", 31 | "rawSpec": "0.0.4", 32 | "spec": "0.0.4", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/engine.io-parser" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", 39 | "_shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", 40 | "_shrinkwrap": null, 41 | "_spec": "blob@0.0.4", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-parser", 43 | "bugs": { 44 | "url": "https://github.com/rase-/blob/issues" 45 | }, 46 | "dependencies": {}, 47 | "description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.", 48 | "devDependencies": { 49 | "browserify": "3.30.1", 50 | "expect.js": "0.2.0", 51 | "mocha": "1.17.1", 52 | "zuul": "1.5.4" 53 | }, 54 | "directories": {}, 55 | "dist": { 56 | "shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", 57 | "tarball": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz" 58 | }, 59 | "homepage": "https://github.com/rase-/blob", 60 | "maintainers": [ 61 | { 62 | "name": "rase-", 63 | "email": "tonykovanen@hotmail.com" 64 | } 65 | ], 66 | "name": "blob", 67 | "optionalDependencies": {}, 68 | "readme": "ERROR: No README data found!", 69 | "repository": { 70 | "type": "git", 71 | "url": "git+ssh://git@github.com/rase-/blob.git" 72 | }, 73 | "scripts": { 74 | "test": "make test" 75 | }, 76 | "version": "0.0.4" 77 | } 78 | -------------------------------------------------------------------------------- /test/node_modules/callsite/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /test/node_modules/callsite/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.0 / 2013-01-24 3 | ================== 4 | 5 | * remove lame magical getters 6 | 7 | 0.0.1 / 2010-01-03 8 | ================== 9 | 10 | * Initial release 11 | -------------------------------------------------------------------------------- /test/node_modules/callsite/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should 5 | 6 | .PHONY: test -------------------------------------------------------------------------------- /test/node_modules/callsite/Readme.md: -------------------------------------------------------------------------------- 1 | # callstack 2 | 3 | Access to v8's "raw" `CallSite`s. 4 | 5 | ## Installation 6 | 7 | $ npm install callsite 8 | 9 | ## Example 10 | 11 | ```js 12 | var stack = require('callsite'); 13 | 14 | foo(); 15 | 16 | function foo() { 17 | bar(); 18 | } 19 | 20 | function bar() { 21 | baz(); 22 | } 23 | 24 | function baz() { 25 | console.log(); 26 | stack().forEach(function(site){ 27 | console.log(' \033[36m%s\033[90m in %s:%d\033[0m' 28 | , site.getFunctionName() || 'anonymous' 29 | , site.getFileName() 30 | , site.getLineNumber()); 31 | }); 32 | console.log(); 33 | } 34 | ``` 35 | 36 | ## Why? 37 | 38 | Because you can do weird, stupid, clever, wacky things such as: 39 | 40 | - [better-assert](https://github.com/visionmedia/better-assert) 41 | 42 | ## License 43 | 44 | MIT 45 | -------------------------------------------------------------------------------- /test/node_modules/callsite/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(){ 3 | var orig = Error.prepareStackTrace; 4 | Error.prepareStackTrace = function(_, stack){ return stack; }; 5 | var err = new Error; 6 | Error.captureStackTrace(err, arguments.callee); 7 | var stack = err.stack; 8 | Error.prepareStackTrace = orig; 9 | return stack; 10 | }; 11 | -------------------------------------------------------------------------------- /test/node_modules/callsite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "callsite@1.0.0", 6 | "scope": null, 7 | "escapedName": "callsite", 8 | "name": "callsite", 9 | "rawSpec": "1.0.0", 10 | "spec": "1.0.0", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/better-assert" 14 | ] 15 | ], 16 | "_from": "callsite@1.0.0", 17 | "_id": "callsite@1.0.0", 18 | "_inCache": true, 19 | "_location": "/callsite", 20 | "_npmUser": { 21 | "name": "tjholowaychuk", 22 | "email": "tj@vision-media.ca" 23 | }, 24 | "_npmVersion": "1.2.2", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "callsite@1.0.0", 28 | "scope": null, 29 | "escapedName": "callsite", 30 | "name": "callsite", 31 | "rawSpec": "1.0.0", 32 | "spec": "1.0.0", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/better-assert" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", 39 | "_shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20", 40 | "_shrinkwrap": null, 41 | "_spec": "callsite@1.0.0", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/better-assert", 43 | "author": { 44 | "name": "TJ Holowaychuk", 45 | "email": "tj@vision-media.ca" 46 | }, 47 | "dependencies": {}, 48 | "description": "access to v8's CallSites", 49 | "devDependencies": { 50 | "mocha": "*", 51 | "should": "*" 52 | }, 53 | "directories": {}, 54 | "dist": { 55 | "shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20", 56 | "tarball": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz" 57 | }, 58 | "engines": { 59 | "node": "*" 60 | }, 61 | "keywords": [ 62 | "stack", 63 | "trace", 64 | "line" 65 | ], 66 | "main": "index", 67 | "maintainers": [ 68 | { 69 | "name": "tjholowaychuk", 70 | "email": "tj@vision-media.ca" 71 | } 72 | ], 73 | "name": "callsite", 74 | "optionalDependencies": {}, 75 | "readme": "ERROR: No README data found!", 76 | "version": "1.0.0" 77 | } 78 | -------------------------------------------------------------------------------- /test/node_modules/component-bind/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /test/node_modules/component-bind/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.0 / 2014-05-27 3 | ================== 4 | 5 | * index: use slice ref (#7, @viatropos) 6 | * package: rename package to "component-bind" 7 | * package: add "repository" field (#6, @repoify) 8 | * package: add "component" section 9 | 10 | 0.0.1 / 2010-01-03 11 | ================== 12 | 13 | * Initial release 14 | -------------------------------------------------------------------------------- /test/node_modules/component-bind/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /test/node_modules/component-bind/Readme.md: -------------------------------------------------------------------------------- 1 | # bind 2 | 3 | Function binding utility. 4 | 5 | ## Installation 6 | 7 | ``` 8 | $ component install component/bind 9 | ``` 10 | 11 | ## API 12 | 13 | - [bind(obj, fn)](#bindobj-fn) 14 | - [bind(obj, fn, ...)](#bindobj-fn-) 15 | - [bind(obj, name)](#bindobj-name) 16 | 17 | 18 | 19 | ### bind(obj, fn) 20 | should bind the function to the given object. 21 | 22 | ```js 23 | var tobi = { name: 'tobi' }; 24 | 25 | function name() { 26 | return this.name; 27 | } 28 | 29 | var fn = bind(tobi, name); 30 | fn().should.equal('tobi'); 31 | ``` 32 | 33 | 34 | ### bind(obj, fn, ...) 35 | should curry the remaining arguments. 36 | 37 | ```js 38 | function add(a, b) { 39 | return a + b; 40 | } 41 | 42 | bind(null, add)(1, 2).should.equal(3); 43 | bind(null, add, 1)(2).should.equal(3); 44 | bind(null, add, 1, 2)().should.equal(3); 45 | ``` 46 | 47 | 48 | ### bind(obj, name) 49 | should bind the method of the given name. 50 | 51 | ```js 52 | var tobi = { name: 'tobi' }; 53 | 54 | tobi.getName = function() { 55 | return this.name; 56 | }; 57 | 58 | var fn = bind(tobi, 'getName'); 59 | fn().should.equal('tobi'); 60 | ``` 61 | 62 | ## License 63 | 64 | MIT -------------------------------------------------------------------------------- /test/node_modules/component-bind/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bind", 3 | "version": "1.0.0", 4 | "description": "function binding utility", 5 | "keywords": [ 6 | "bind", 7 | "utility" 8 | ], 9 | "dependencies": {}, 10 | "scripts": [ 11 | "index.js" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/node_modules/component-bind/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Slice reference. 3 | */ 4 | 5 | var slice = [].slice; 6 | 7 | /** 8 | * Bind `obj` to `fn`. 9 | * 10 | * @param {Object} obj 11 | * @param {Function|String} fn or string 12 | * @return {Function} 13 | * @api public 14 | */ 15 | 16 | module.exports = function(obj, fn){ 17 | if ('string' == typeof fn) fn = obj[fn]; 18 | if ('function' != typeof fn) throw new Error('bind() requires a function'); 19 | var args = slice.call(arguments, 2); 20 | return function(){ 21 | return fn.apply(obj, args.concat(slice.call(arguments))); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /test/node_modules/component-bind/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "component-bind@1.0.0", 6 | "scope": null, 7 | "escapedName": "component-bind", 8 | "name": "component-bind", 9 | "rawSpec": "1.0.0", 10 | "spec": "1.0.0", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "component-bind@1.0.0", 17 | "_id": "component-bind@1.0.0", 18 | "_inCache": true, 19 | "_location": "/component-bind", 20 | "_npmUser": { 21 | "name": "tootallnate", 22 | "email": "nathan@tootallnate.net" 23 | }, 24 | "_npmVersion": "1.4.9", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "component-bind@1.0.0", 28 | "scope": null, 29 | "escapedName": "component-bind", 30 | "name": "component-bind", 31 | "rawSpec": "1.0.0", 32 | "spec": "1.0.0", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/socket.io-client" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", 39 | "_shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1", 40 | "_shrinkwrap": null, 41 | "_spec": "component-bind@1.0.0", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 43 | "bugs": { 44 | "url": "https://github.com/component/bind/issues" 45 | }, 46 | "component": { 47 | "scripts": { 48 | "bind/index.js": "index.js" 49 | } 50 | }, 51 | "dependencies": {}, 52 | "description": "function binding utility", 53 | "devDependencies": { 54 | "mocha": "*", 55 | "should": "*" 56 | }, 57 | "directories": {}, 58 | "dist": { 59 | "shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1", 60 | "tarball": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz" 61 | }, 62 | "homepage": "https://github.com/component/bind", 63 | "keywords": [ 64 | "bind", 65 | "utility" 66 | ], 67 | "maintainers": [ 68 | { 69 | "name": "tootallnate", 70 | "email": "nathan@tootallnate.net" 71 | } 72 | ], 73 | "name": "component-bind", 74 | "optionalDependencies": {}, 75 | "readme": "ERROR: No README data found!", 76 | "repository": { 77 | "type": "git", 78 | "url": "git+https://github.com/component/bind.git" 79 | }, 80 | "version": "1.0.0" 81 | } 82 | -------------------------------------------------------------------------------- /test/node_modules/component-emitter/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.2.1 / 2016-04-18 3 | ================== 4 | 5 | * enable client side use 6 | 7 | 1.2.0 / 2014-02-12 8 | ================== 9 | 10 | * prefix events with `$` to support object prototype method names 11 | 12 | 1.1.3 / 2014-06-20 13 | ================== 14 | 15 | * republish for npm 16 | * add LICENSE file 17 | 18 | 1.1.2 / 2014-02-10 19 | ================== 20 | 21 | * package: rename to "component-emitter" 22 | * package: update "main" and "component" fields 23 | * Add license to Readme (same format as the other components) 24 | * created .npmignore 25 | * travis stuff 26 | 27 | 1.1.1 / 2013-12-01 28 | ================== 29 | 30 | * fix .once adding .on to the listener 31 | * docs: Emitter#off() 32 | * component: add `.repo` prop 33 | 34 | 1.1.0 / 2013-10-20 35 | ================== 36 | 37 | * add `.addEventListener()` and `.removeEventListener()` aliases 38 | 39 | 1.0.1 / 2013-06-27 40 | ================== 41 | 42 | * add support for legacy ie 43 | 44 | 1.0.0 / 2013-02-26 45 | ================== 46 | 47 | * add `.off()` support for removing all listeners 48 | 49 | 0.0.6 / 2012-10-08 50 | ================== 51 | 52 | * add `this._callbacks` initialization to prevent funky gotcha 53 | 54 | 0.0.5 / 2012-09-07 55 | ================== 56 | 57 | * fix `Emitter.call(this)` usage 58 | 59 | 0.0.3 / 2012-07-11 60 | ================== 61 | 62 | * add `.listeners()` 63 | * rename `.has()` to `.hasListeners()` 64 | 65 | 0.0.2 / 2012-06-28 66 | ================== 67 | 68 | * fix `.off()` with `.once()`-registered callbacks 69 | -------------------------------------------------------------------------------- /test/node_modules/component-emitter/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Component contributors 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /test/node_modules/component-emitter/Readme.md: -------------------------------------------------------------------------------- 1 | # Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter) 2 | 3 | Event emitter component. 4 | 5 | ## Installation 6 | 7 | ``` 8 | $ component install component/emitter 9 | ``` 10 | 11 | ## API 12 | 13 | ### Emitter(obj) 14 | 15 | The `Emitter` may also be used as a mixin. For example 16 | a "plain" object may become an emitter, or you may 17 | extend an existing prototype. 18 | 19 | As an `Emitter` instance: 20 | 21 | ```js 22 | var Emitter = require('emitter'); 23 | var emitter = new Emitter; 24 | emitter.emit('something'); 25 | ``` 26 | 27 | As a mixin: 28 | 29 | ```js 30 | var Emitter = require('emitter'); 31 | var user = { name: 'tobi' }; 32 | Emitter(user); 33 | 34 | user.emit('im a user'); 35 | ``` 36 | 37 | As a prototype mixin: 38 | 39 | ```js 40 | var Emitter = require('emitter'); 41 | Emitter(User.prototype); 42 | ``` 43 | 44 | ### Emitter#on(event, fn) 45 | 46 | Register an `event` handler `fn`. 47 | 48 | ### Emitter#once(event, fn) 49 | 50 | Register a single-shot `event` handler `fn`, 51 | removed immediately after it is invoked the 52 | first time. 53 | 54 | ### Emitter#off(event, fn) 55 | 56 | * Pass `event` and `fn` to remove a listener. 57 | * Pass `event` to remove all listeners on that event. 58 | * Pass nothing to remove all listeners on all events. 59 | 60 | ### Emitter#emit(event, ...) 61 | 62 | Emit an `event` with variable option args. 63 | 64 | ### Emitter#listeners(event) 65 | 66 | Return an array of callbacks, or an empty array. 67 | 68 | ### Emitter#hasListeners(event) 69 | 70 | Check if this emitter has `event` handlers. 71 | 72 | ## License 73 | 74 | MIT 75 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | node_modules 4 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.2 / 2012-09-03 3 | ================== 4 | 5 | * fix typo in package.json 6 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | test: 12 | @node_modules/.bin/mocha \ 13 | --require should \ 14 | --reporter spec 15 | 16 | .PHONY: clean test 17 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/Readme.md: -------------------------------------------------------------------------------- 1 | # inherit 2 | 3 | Prototype inheritance utility. 4 | 5 | ## Installation 6 | 7 | ``` 8 | $ component install component/inherit 9 | ``` 10 | 11 | ## Example 12 | 13 | ```js 14 | var inherit = require('inherit'); 15 | 16 | function Human() {} 17 | function Woman() {} 18 | 19 | inherit(Woman, Human); 20 | ``` 21 | 22 | ## License 23 | 24 | MIT 25 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherit", 3 | "description": "Prototype inheritance utility", 4 | "version": "0.0.3", 5 | "keywords": ["inherit", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(a, b){ 3 | var fn = function(){}; 4 | fn.prototype = b.prototype; 5 | a.prototype = new fn; 6 | a.prototype.constructor = a; 7 | }; -------------------------------------------------------------------------------- /test/node_modules/component-inherit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "component-inherit@0.0.3", 6 | "scope": null, 7 | "escapedName": "component-inherit", 8 | "name": "component-inherit", 9 | "rawSpec": "0.0.3", 10 | "spec": "0.0.3", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-client" 14 | ] 15 | ], 16 | "_from": "component-inherit@0.0.3", 17 | "_id": "component-inherit@0.0.3", 18 | "_inCache": true, 19 | "_location": "/component-inherit", 20 | "_npmUser": { 21 | "name": "coreh", 22 | "email": "thecoreh@gmail.com" 23 | }, 24 | "_npmVersion": "1.3.24", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "component-inherit@0.0.3", 28 | "scope": null, 29 | "escapedName": "component-inherit", 30 | "name": "component-inherit", 31 | "rawSpec": "0.0.3", 32 | "spec": "0.0.3", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/engine.io-client" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", 39 | "_shasum": "645fc4adf58b72b649d5cae65135619db26ff143", 40 | "_shrinkwrap": null, 41 | "_spec": "component-inherit@0.0.3", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-client", 43 | "bugs": { 44 | "url": "https://github.com/component/inherit/issues" 45 | }, 46 | "component": { 47 | "scripts": { 48 | "inherit/index.js": "index.js" 49 | } 50 | }, 51 | "dependencies": {}, 52 | "description": "Prototype inheritance utility", 53 | "devDependencies": {}, 54 | "directories": {}, 55 | "dist": { 56 | "shasum": "645fc4adf58b72b649d5cae65135619db26ff143", 57 | "tarball": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz" 58 | }, 59 | "homepage": "https://github.com/component/inherit", 60 | "keywords": [ 61 | "inherit", 62 | "utility" 63 | ], 64 | "maintainers": [ 65 | { 66 | "name": "coreh", 67 | "email": "thecoreh@gmail.com" 68 | } 69 | ], 70 | "name": "component-inherit", 71 | "optionalDependencies": {}, 72 | "readme": "ERROR: No README data found!", 73 | "repository": { 74 | "type": "git", 75 | "url": "git+https://github.com/component/inherit.git" 76 | }, 77 | "version": "0.0.3" 78 | } 79 | -------------------------------------------------------------------------------- /test/node_modules/component-inherit/test/inherit.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var inherit = require('..'); 7 | 8 | describe('inherit(a, b)', function(){ 9 | it('should inherit b\'s prototype', function(){ 10 | function Loki(){} 11 | function Animal(){} 12 | 13 | Animal.prototype.species = 'unknown'; 14 | 15 | inherit(Loki, Animal); 16 | 17 | var loki = new Loki; 18 | loki.species.should.equal('unknown'); 19 | loki.constructor.should.equal(Loki); 20 | }) 21 | }) -------------------------------------------------------------------------------- /test/node_modules/cookie/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012-2014 Roman Shtylman 4 | Copyright (c) 2015 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | -------------------------------------------------------------------------------- /test/node_modules/debug/.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve 2 | -------------------------------------------------------------------------------- /test/node_modules/debug/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true 5 | }, 6 | "rules": { 7 | "no-console": 0, 8 | "no-empty": [1, { "allowEmptyCatch": true }] 9 | }, 10 | "extends": "eslint:recommended" 11 | } 12 | -------------------------------------------------------------------------------- /test/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | yarn.lock 8 | coverage 9 | bower.json 10 | -------------------------------------------------------------------------------- /test/node_modules/debug/.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | language: node_js 3 | node_js: 4 | - "6" 5 | - "5" 6 | - "4" 7 | 8 | install: 9 | - make node_modules 10 | 11 | script: 12 | - make lint 13 | - make test 14 | - make coveralls 15 | -------------------------------------------------------------------------------- /test/node_modules/debug/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | and associated documentation files (the 'Software'), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /test/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 2 | THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) 3 | THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) 4 | 5 | # BIN directory 6 | BIN := $(THIS_DIR)/node_modules/.bin 7 | 8 | # Path 9 | PATH := node_modules/.bin:$(PATH) 10 | SHELL := /bin/bash 11 | 12 | # applications 13 | NODE ?= $(shell which node) 14 | YARN ?= $(shell which yarn) 15 | PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) 16 | BROWSERIFY ?= $(NODE) $(BIN)/browserify 17 | 18 | .FORCE: 19 | 20 | install: node_modules 21 | 22 | node_modules: package.json 23 | @NODE_ENV= $(PKG) install 24 | @touch node_modules 25 | 26 | lint: .FORCE 27 | eslint browser.js debug.js index.js node.js 28 | 29 | test-node: .FORCE 30 | istanbul cover node_modules/mocha/bin/_mocha -- test/**.js 31 | 32 | test-browser: .FORCE 33 | mkdir -p dist 34 | 35 | @$(BROWSERIFY) \ 36 | --standalone debug \ 37 | . > dist/debug.js 38 | 39 | karma start --single-run 40 | rimraf dist 41 | 42 | test: .FORCE 43 | concurrently \ 44 | "make test-node" \ 45 | "make test-browser" 46 | 47 | coveralls: 48 | cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js 49 | 50 | .PHONY: all install clean distclean 51 | -------------------------------------------------------------------------------- /test/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.6.8", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "src/browser.js", 12 | "scripts": [ 13 | "src/browser.js", 14 | "src/debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/node_modules/debug/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['mocha', 'chai', 'sinon'], 14 | 15 | 16 | // list of files / patterns to load in the browser 17 | files: [ 18 | 'dist/debug.js', 19 | 'test/*spec.js' 20 | ], 21 | 22 | 23 | // list of files to exclude 24 | exclude: [ 25 | 'src/node.js' 26 | ], 27 | 28 | 29 | // preprocess matching files before serving them to the browser 30 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 31 | preprocessors: { 32 | }, 33 | 34 | // test results reporter to use 35 | // possible values: 'dots', 'progress' 36 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 37 | reporters: ['progress'], 38 | 39 | 40 | // web server port 41 | port: 9876, 42 | 43 | 44 | // enable / disable colors in the output (reporters and logs) 45 | colors: true, 46 | 47 | 48 | // level of logging 49 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 50 | logLevel: config.LOG_INFO, 51 | 52 | 53 | // enable / disable watching file and executing tests whenever any file changes 54 | autoWatch: true, 55 | 56 | 57 | // start these browsers 58 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 59 | browsers: ['PhantomJS'], 60 | 61 | 62 | // Continuous Integration mode 63 | // if true, Karma captures browsers, runs the tests and exits 64 | singleRun: false, 65 | 66 | // Concurrency level 67 | // how many browser should be started simultaneous 68 | concurrency: Infinity 69 | }) 70 | } 71 | -------------------------------------------------------------------------------- /test/node_modules/debug/node.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./src/node'); 2 | -------------------------------------------------------------------------------- /test/node_modules/debug/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Detect Electron renderer process, which is node, but we should 3 | * treat as a browser. 4 | */ 5 | 6 | if (typeof process !== 'undefined' && process.type === 'renderer') { 7 | module.exports = require('./browser.js'); 8 | } else { 9 | module.exports = require('./node.js'); 10 | } 11 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-client/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2015 Automattic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-client/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/index'); 3 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-client/lib/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./socket'); 3 | 4 | /** 5 | * Exports parser 6 | * 7 | * @api public 8 | * 9 | */ 10 | module.exports.parser = require('engine.io-parser'); 11 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-client/lib/transports/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies 3 | */ 4 | 5 | var XMLHttpRequest = require('xmlhttprequest-ssl'); 6 | var XHR = require('./polling-xhr'); 7 | var JSONP = require('./polling-jsonp'); 8 | var websocket = require('./websocket'); 9 | 10 | /** 11 | * Export transports. 12 | */ 13 | 14 | exports.polling = polling; 15 | exports.websocket = websocket; 16 | 17 | /** 18 | * Polling transport polymorphic constructor. 19 | * Decides on xhr vs jsonp based on feature detection. 20 | * 21 | * @api private 22 | */ 23 | 24 | function polling (opts) { 25 | var xhr; 26 | var xd = false; 27 | var xs = false; 28 | var jsonp = false !== opts.jsonp; 29 | 30 | if (global.location) { 31 | var isSSL = 'https:' === location.protocol; 32 | var port = location.port; 33 | 34 | // some user agents have empty `location.port` 35 | if (!port) { 36 | port = isSSL ? 443 : 80; 37 | } 38 | 39 | xd = opts.hostname !== location.hostname || port !== opts.port; 40 | xs = opts.secure !== isSSL; 41 | } 42 | 43 | opts.xdomain = xd; 44 | opts.xscheme = xs; 45 | xhr = new XMLHttpRequest(opts); 46 | 47 | if ('open' in xhr && !opts.forceJSONP) { 48 | return new XHR(opts); 49 | } else { 50 | if (!jsonp) throw new Error('JSONP disabled'); 51 | return new JSONP(opts); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-client/lib/xmlhttprequest.js: -------------------------------------------------------------------------------- 1 | // browser shim for xmlhttprequest module 2 | 3 | var hasCORS = require('has-cors'); 4 | 5 | module.exports = function (opts) { 6 | var xdomain = opts.xdomain; 7 | 8 | // scheme must be same when usign XDomainRequest 9 | // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx 10 | var xscheme = opts.xscheme; 11 | 12 | // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default. 13 | // https://github.com/Automattic/engine.io-client/pull/217 14 | var enablesXDR = opts.enablesXDR; 15 | 16 | // XMLHttpRequest can be disabled on IE 17 | try { 18 | if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) { 19 | return new XMLHttpRequest(); 20 | } 21 | } catch (e) { } 22 | 23 | // Use XDomainRequest for IE8 if enablesXDR is true 24 | // because loading bar keeps flashing when using jsonp-polling 25 | // https://github.com/yujiosaka/socke.io-ie8-loading-example 26 | try { 27 | if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) { 28 | return new XDomainRequest(); 29 | } 30 | } catch (e) { } 31 | 32 | if (!xdomain) { 33 | try { 34 | return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); 35 | } catch (e) { } 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-parser/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2016 Guillermo Rauch (@rauchg) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/node_modules/engine.io-parser/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/'); 3 | -------------------------------------------------------------------------------- /test/node_modules/engine.io-parser/lib/keys.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Gets the keys for an object. 4 | * 5 | * @return {Array} keys 6 | * @api private 7 | */ 8 | 9 | module.exports = Object.keys || function keys (obj){ 10 | var arr = []; 11 | var has = Object.prototype.hasOwnProperty; 12 | 13 | for (var i in obj) { 14 | if (has.call(obj, i)) { 15 | arr.push(i); 16 | } 17 | } 18 | return arr; 19 | }; 20 | -------------------------------------------------------------------------------- /test/node_modules/engine.io/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | and associated documentation files (the 'Software'), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 8 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or 12 | substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 15 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /test/node_modules/engine.io/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.EIO_COV 3 | ? require('./lib-cov/engine.io') 4 | : require('./lib/engine.io'); 5 | -------------------------------------------------------------------------------- /test/node_modules/engine.io/lib/transports/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var XHR = require('./polling-xhr'); 7 | var JSONP = require('./polling-jsonp'); 8 | 9 | /** 10 | * Export transports. 11 | */ 12 | 13 | module.exports = exports = { 14 | polling: polling, 15 | websocket: require('./websocket') 16 | }; 17 | 18 | /** 19 | * Export upgrades map. 20 | */ 21 | 22 | exports.polling.upgradesTo = ['websocket']; 23 | 24 | /** 25 | * Polling polymorphic constructor. 26 | * 27 | * @api private 28 | */ 29 | 30 | function polling (req) { 31 | if ('string' === typeof req._query.j) { 32 | return new JSONP(req); 33 | } else { 34 | return new XHR(req); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/node_modules/engine.io/lib/transports/polling-jsonp.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Polling = require('./polling'); 7 | var qs = require('querystring'); 8 | var rDoubleSlashes = /\\\\n/g; 9 | var rSlashes = /(\\)?\\n/g; 10 | var util = require('util'); 11 | 12 | /** 13 | * Module exports. 14 | */ 15 | 16 | module.exports = JSONP; 17 | 18 | /** 19 | * JSON-P polling transport. 20 | * 21 | * @api public 22 | */ 23 | 24 | function JSONP (req) { 25 | Polling.call(this, req); 26 | 27 | this.head = '___eio[' + (req._query.j || '').replace(/[^0-9]/g, '') + ']('; 28 | this.foot = ');'; 29 | } 30 | 31 | /** 32 | * Inherits from Polling. 33 | */ 34 | 35 | util.inherits(JSONP, Polling); 36 | 37 | /** 38 | * Handles incoming data. 39 | * Due to a bug in \n handling by browsers, we expect a escaped string. 40 | * 41 | * @api private 42 | */ 43 | 44 | JSONP.prototype.onData = function (data) { 45 | // we leverage the qs module so that we get built-in DoS protection 46 | // and the fast alternative to decodeURIComponent 47 | data = qs.parse(data).d; 48 | if ('string' === typeof data) { 49 | // client will send already escaped newlines as \\\\n and newlines as \\n 50 | // \\n must be replaced with \n and \\\\n with \\n 51 | data = data.replace(rSlashes, function (match, slashes) { 52 | return slashes ? match : '\n'; 53 | }); 54 | Polling.prototype.onData.call(this, data.replace(rDoubleSlashes, '\\n')); 55 | } 56 | }; 57 | 58 | /** 59 | * Performs the write. 60 | * 61 | * @api private 62 | */ 63 | 64 | JSONP.prototype.doWrite = function (data, options, callback) { 65 | // we must output valid javascript, not valid json 66 | // see: http://timelessrepo.com/json-isnt-a-javascript-subset 67 | var js = JSON.stringify(data) 68 | .replace(/\u2028/g, '\\u2028') 69 | .replace(/\u2029/g, '\\u2029'); 70 | 71 | // prepare response 72 | data = this.head + js + this.foot; 73 | 74 | Polling.prototype.doWrite.call(this, data, options, callback); 75 | }; 76 | -------------------------------------------------------------------------------- /test/node_modules/engine.io/lib/transports/polling-xhr.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Polling = require('./polling'); 7 | var util = require('util'); 8 | 9 | /** 10 | * Module exports. 11 | */ 12 | 13 | module.exports = XHR; 14 | 15 | /** 16 | * Ajax polling transport. 17 | * 18 | * @api public 19 | */ 20 | 21 | function XHR (req) { 22 | Polling.call(this, req); 23 | } 24 | 25 | /** 26 | * Inherits from Polling. 27 | */ 28 | 29 | util.inherits(XHR, Polling); 30 | 31 | /** 32 | * Overrides `onRequest` to handle `OPTIONS`.. 33 | * 34 | * @param {http.IncomingMessage} 35 | * @api private 36 | */ 37 | 38 | XHR.prototype.onRequest = function (req) { 39 | if ('OPTIONS' === req.method) { 40 | var res = req.res; 41 | var headers = this.headers(req); 42 | headers['Access-Control-Allow-Headers'] = 'Content-Type'; 43 | res.writeHead(200, headers); 44 | res.end(); 45 | } else { 46 | Polling.prototype.onRequest.call(this, req); 47 | } 48 | }; 49 | 50 | /** 51 | * Returns headers for a response. 52 | * 53 | * @param {http.IncomingMessage} request 54 | * @param {Object} extra headers 55 | * @api private 56 | */ 57 | 58 | XHR.prototype.headers = function (req, headers) { 59 | headers = headers || {}; 60 | 61 | if (req.headers.origin) { 62 | headers['Access-Control-Allow-Credentials'] = 'true'; 63 | headers['Access-Control-Allow-Origin'] = req.headers.origin; 64 | } else { 65 | headers['Access-Control-Allow-Origin'] = '*'; 66 | } 67 | 68 | return Polling.prototype.headers.call(this, req, headers); 69 | }; 70 | -------------------------------------------------------------------------------- /test/node_modules/has-binary2/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.2 / 2017-04-27 3 | ================== 4 | 5 | * fix(*): Fix Blob detection for iOS 8/9 6 | 7 | 1.0.1 / 2017-04-05 8 | ================== 9 | 10 | * chore(*): restrict files included in npm package 11 | 12 | 1.0.0 / 2017-04-05 13 | ================== 14 | 15 | * chore(*): update package name 16 | * fix(*): do not call toJSON more than once (#7) 17 | * fix(*): Ensure globals are functions before running `instanceof` checks against them. (#4) 18 | * fix(*): fix the case when toJSON() returns a Buffer (#6) 19 | * chore(*): Bump dependencies, add semistandard checkstyle and travis configuration (#5) 20 | * perf(*): Performance improvements (#3) 21 | 22 | 0.1.7 / 2015-11-18 23 | ================== 24 | 25 | * fix toJSON [@jderuere] 26 | * fix `global.isBuffer` usage [@tonetheman] 27 | * fix tests on modern versions of node 28 | * bump mocha 29 | 30 | 0.1.6 / 2015-01-24 31 | ================== 32 | 33 | * fix "undefined function" bug when iterating 34 | an object created with Object.create(null) [gunta] 35 | 36 | 0.1.5 / 2014-09-04 37 | ================== 38 | 39 | * prevent browserify from bundling `Buffer` 40 | -------------------------------------------------------------------------------- /test/node_modules/has-binary2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Kevin Roark 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/node_modules/has-binary2/README.md: -------------------------------------------------------------------------------- 1 | has-binarydata.js 2 | ================= 3 | 4 | Simple module to test if an object contains binary data 5 | -------------------------------------------------------------------------------- /test/node_modules/has-binary2/index.js: -------------------------------------------------------------------------------- 1 | /* global Blob File */ 2 | 3 | /* 4 | * Module requirements. 5 | */ 6 | 7 | var isArray = require('isarray'); 8 | 9 | var toString = Object.prototype.toString; 10 | var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]'; 11 | var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]'; 12 | 13 | /** 14 | * Module exports. 15 | */ 16 | 17 | module.exports = hasBinary; 18 | 19 | /** 20 | * Checks for binary data. 21 | * 22 | * Supports Buffer, ArrayBuffer, Blob and File. 23 | * 24 | * @param {Object} anything 25 | * @api public 26 | */ 27 | 28 | function hasBinary (obj) { 29 | if (!obj || typeof obj !== 'object') { 30 | return false; 31 | } 32 | 33 | if (isArray(obj)) { 34 | for (var i = 0, l = obj.length; i < l; i++) { 35 | if (hasBinary(obj[i])) { 36 | return true; 37 | } 38 | } 39 | return false; 40 | } 41 | 42 | if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) || 43 | (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) || 44 | (withNativeBlob && obj instanceof Blob) || 45 | (withNativeFile && obj instanceof File) 46 | ) { 47 | return true; 48 | } 49 | 50 | // see: https://github.com/Automattic/has-binary/pull/4 51 | if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) { 52 | return hasBinary(obj.toJSON(), true); 53 | } 54 | 55 | for (var key in obj) { 56 | if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { 57 | return true; 58 | } 59 | } 60 | 61 | return false; 62 | } 63 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | node_modules 4 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.1.0 / 2014-11-12 3 | ================== 4 | 5 | * remove "global" module dependency (#2, @achingbrain) 6 | 7 | 1.0.2 / 2013-08-27 8 | ================== 9 | 10 | * explicitly use `global` instead of being implicit 11 | * pin "component/global" to v2.0.1 12 | 13 | 1.0.1 / 2013-08-23 14 | ================== 15 | 16 | * package: add "component" section 17 | 18 | 1.0.0 / 2013-08-22 19 | ================== 20 | 21 | * Initial release 22 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build --dev 4 | 5 | components: component.json 6 | @component install --dev 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # has-cors 3 | 4 | Detects support for Cross-Origin Resource Sharing 5 | 6 | ## Installation 7 | 8 | Install with [component(1)](http://component.io): 9 | 10 | $ component install component/has-cors 11 | 12 | ## API 13 | 14 | Exports `true` if the user-agent supports CORS, or `false` otherwise. 15 | 16 | ``` js 17 | var hasCORS = require('has-cors'); 18 | console.log(hasCORS); 19 | // true 20 | ``` 21 | 22 | ## License 23 | 24 | MIT 25 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "has-cors", 3 | "repo": "component/has-cors", 4 | "description": "Detects support for Cross-Origin Resource Sharing", 5 | "version": "1.1.0", 6 | "keywords": [], 7 | "development": {}, 8 | "license": "MIT", 9 | "main": "index.js", 10 | "scripts": [ 11 | "index.js" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module exports. 4 | * 5 | * Logic borrowed from Modernizr: 6 | * 7 | * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js 8 | */ 9 | 10 | try { 11 | module.exports = typeof XMLHttpRequest !== 'undefined' && 12 | 'withCredentials' in new XMLHttpRequest(); 13 | } catch (err) { 14 | // if XMLHttp support is disabled in IE then it will throw 15 | // when trying to create 16 | module.exports = false; 17 | } 18 | -------------------------------------------------------------------------------- /test/node_modules/has-cors/test.js: -------------------------------------------------------------------------------- 1 | var expect = require('chai').expect; 2 | 3 | describe('has-cors', function() { 4 | beforeEach(function() { 5 | // make sure result is not cached 6 | delete require.cache[require.resolve('./')]; 7 | }); 8 | 9 | it('should not have cors', function() { 10 | var hasCors = require('./'); 11 | 12 | expect(hasCors).to.be.false; 13 | }); 14 | 15 | it('should have cors', function() { 16 | global.XMLHttpRequest = function() { 17 | this.withCredentials = true; 18 | }; 19 | 20 | var hasCors = require('./'); 21 | 22 | expect(hasCors).to.be.true; 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/node_modules/indexof/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /test/node_modules/indexof/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /test/node_modules/indexof/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # indexOf 3 | 4 | Lame indexOf thing, thanks microsoft 5 | 6 | ## Example 7 | 8 | ```js 9 | var index = require('indexof'); 10 | index(arr, obj); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /test/node_modules/indexof/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "indexof", 3 | "description": "Microsoft sucks", 4 | "version": "0.0.1", 5 | "keywords": ["index", "array", "indexOf"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/node_modules/indexof/index.js: -------------------------------------------------------------------------------- 1 | 2 | var indexOf = [].indexOf; 3 | 4 | module.exports = function(arr, obj){ 5 | if (indexOf) return arr.indexOf(obj); 6 | for (var i = 0; i < arr.length; ++i) { 7 | if (arr[i] === obj) return i; 8 | } 9 | return -1; 10 | }; -------------------------------------------------------------------------------- /test/node_modules/indexof/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "indexof@0.0.1", 6 | "scope": null, 7 | "escapedName": "indexof", 8 | "name": "indexof", 9 | "rawSpec": "0.0.1", 10 | "spec": "0.0.1", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "indexof@0.0.1", 17 | "_id": "indexof@0.0.1", 18 | "_inCache": true, 19 | "_location": "/indexof", 20 | "_phantomChildren": {}, 21 | "_requested": { 22 | "raw": "indexof@0.0.1", 23 | "scope": null, 24 | "escapedName": "indexof", 25 | "name": "indexof", 26 | "rawSpec": "0.0.1", 27 | "spec": "0.0.1", 28 | "type": "version" 29 | }, 30 | "_requiredBy": [ 31 | "/engine.io-client", 32 | "/socket.io-client" 33 | ], 34 | "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", 35 | "_shasum": "82dc336d232b9062179d05ab3293a66059fd435d", 36 | "_shrinkwrap": null, 37 | "_spec": "indexof@0.0.1", 38 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 39 | "component": { 40 | "scripts": { 41 | "indexof/index.js": "index.js" 42 | } 43 | }, 44 | "dependencies": {}, 45 | "description": "Microsoft sucks", 46 | "devDependencies": {}, 47 | "directories": {}, 48 | "dist": { 49 | "shasum": "82dc336d232b9062179d05ab3293a66059fd435d", 50 | "tarball": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" 51 | }, 52 | "keywords": [ 53 | "index", 54 | "array", 55 | "indexOf" 56 | ], 57 | "maintainers": [ 58 | { 59 | "name": "tjholowaychuk", 60 | "email": "tj@vision-media.ca" 61 | } 62 | ], 63 | "name": "indexof", 64 | "optionalDependencies": {}, 65 | "readme": "ERROR: No README data found!", 66 | "version": "0.0.1" 67 | } 68 | -------------------------------------------------------------------------------- /test/node_modules/isarray/README.md: -------------------------------------------------------------------------------- 1 | 2 | # isarray 3 | 4 | `Array#isArray` for older browsers. 5 | 6 | [![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) 7 | [![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) 8 | 9 | [![browser support](https://ci.testling.com/juliangruber/isarray.png) 10 | ](https://ci.testling.com/juliangruber/isarray) 11 | 12 | ## Usage 13 | 14 | ```js 15 | var isArray = require('isarray'); 16 | 17 | console.log(isArray([])); // => true 18 | console.log(isArray({})); // => false 19 | ``` 20 | 21 | ## Installation 22 | 23 | With [npm](https://npmjs.org) do 24 | 25 | ```bash 26 | $ npm install isarray 27 | ``` 28 | 29 | Then bundle for the browser with 30 | [browserify](https://github.com/substack/node-browserify). 31 | 32 | ## License 33 | 34 | (MIT) 35 | 36 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | this software and associated documentation files (the "Software"), to deal in 40 | the Software without restriction, including without limitation the rights to 41 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | of the Software, and to permit persons to whom the Software is furnished to do 43 | so, subject to the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be included in all 46 | copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | SOFTWARE. 55 | -------------------------------------------------------------------------------- /test/node_modules/isarray/index.js: -------------------------------------------------------------------------------- 1 | var toString = {}.toString; 2 | 3 | module.exports = Array.isArray || function (arr) { 4 | return toString.call(arr) == '[object Array]'; 5 | }; 6 | -------------------------------------------------------------------------------- /test/node_modules/mime-db/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Jonathan Ong me@jongleberry.com 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/mime-db/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mime-db 3 | * Copyright(c) 2014 Jonathan Ong 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = require('./db.json') 12 | -------------------------------------------------------------------------------- /test/node_modules/mime-types/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Jonathan Ong 4 | Copyright (c) 2015 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /test/node_modules/ms/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Zeit, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/ms/readme.md: -------------------------------------------------------------------------------- 1 | # ms 2 | 3 | [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) 4 | [![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) 5 | 6 | Use this package to easily convert various time formats to milliseconds. 7 | 8 | ## Examples 9 | 10 | ```js 11 | ms('2 days') // 172800000 12 | ms('1d') // 86400000 13 | ms('10h') // 36000000 14 | ms('2.5 hrs') // 9000000 15 | ms('2h') // 7200000 16 | ms('1m') // 60000 17 | ms('5s') // 5000 18 | ms('1y') // 31557600000 19 | ms('100') // 100 20 | ``` 21 | 22 | ### Convert from milliseconds 23 | 24 | ```js 25 | ms(60000) // "1m" 26 | ms(2 * 60000) // "2m" 27 | ms(ms('10 hours')) // "10h" 28 | ``` 29 | 30 | ### Time format written-out 31 | 32 | ```js 33 | ms(60000, { long: true }) // "1 minute" 34 | ms(2 * 60000, { long: true }) // "2 minutes" 35 | ms(ms('10 hours'), { long: true }) // "10 hours" 36 | ``` 37 | 38 | ## Features 39 | 40 | - Works both in [node](https://nodejs.org) and in the browser. 41 | - If a number is supplied to `ms`, a string with a unit is returned. 42 | - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). 43 | - If you pass a string with a number and a valid unit, the number of equivalent ms is returned. 44 | 45 | ## Caught a bug? 46 | 47 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 48 | 2. Link the package to the global module directory: `npm link` 49 | 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! 50 | 51 | As always, you can run the tests using: `npm test` 52 | -------------------------------------------------------------------------------- /test/node_modules/negotiator/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012-2014 Federico Romero 4 | Copyright (c) 2012-2014 Isaac Z. Schlueter 5 | Copyright (c) 2014-2015 Douglas Christopher Wilson 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /test/node_modules/object-assign/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | 'use strict'; 8 | /* eslint-disable no-unused-vars */ 9 | var getOwnPropertySymbols = Object.getOwnPropertySymbols; 10 | var hasOwnProperty = Object.prototype.hasOwnProperty; 11 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; 12 | 13 | function toObject(val) { 14 | if (val === null || val === undefined) { 15 | throw new TypeError('Object.assign cannot be called with null or undefined'); 16 | } 17 | 18 | return Object(val); 19 | } 20 | 21 | function shouldUseNative() { 22 | try { 23 | if (!Object.assign) { 24 | return false; 25 | } 26 | 27 | // Detect buggy property enumeration order in older V8 versions. 28 | 29 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 30 | var test1 = new String('abc'); // eslint-disable-line no-new-wrappers 31 | test1[5] = 'de'; 32 | if (Object.getOwnPropertyNames(test1)[0] === '5') { 33 | return false; 34 | } 35 | 36 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 37 | var test2 = {}; 38 | for (var i = 0; i < 10; i++) { 39 | test2['_' + String.fromCharCode(i)] = i; 40 | } 41 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) { 42 | return test2[n]; 43 | }); 44 | if (order2.join('') !== '0123456789') { 45 | return false; 46 | } 47 | 48 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 49 | var test3 = {}; 50 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { 51 | test3[letter] = letter; 52 | }); 53 | if (Object.keys(Object.assign({}, test3)).join('') !== 54 | 'abcdefghijklmnopqrst') { 55 | return false; 56 | } 57 | 58 | return true; 59 | } catch (err) { 60 | // We don't expect any of the above to throw, but better to be safe. 61 | return false; 62 | } 63 | } 64 | 65 | module.exports = shouldUseNative() ? Object.assign : function (target, source) { 66 | var from; 67 | var to = toObject(target); 68 | var symbols; 69 | 70 | for (var s = 1; s < arguments.length; s++) { 71 | from = Object(arguments[s]); 72 | 73 | for (var key in from) { 74 | if (hasOwnProperty.call(from, key)) { 75 | to[key] = from[key]; 76 | } 77 | } 78 | 79 | if (getOwnPropertySymbols) { 80 | symbols = getOwnPropertySymbols(from); 81 | for (var i = 0; i < symbols.length; i++) { 82 | if (propIsEnumerable.call(from, symbols[i])) { 83 | to[symbols[i]] = from[symbols[i]]; 84 | } 85 | } 86 | } 87 | } 88 | 89 | return to; 90 | }; 91 | -------------------------------------------------------------------------------- /test/node_modules/object-assign/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/object-assign/readme.md: -------------------------------------------------------------------------------- 1 | # object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) 2 | 3 | > ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Use the built-in 7 | 8 | Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), 9 | support `Object.assign()` :tada:. If you target only those environments, then by all 10 | means, use `Object.assign()` instead of this package. 11 | 12 | 13 | ## Install 14 | 15 | ``` 16 | $ npm install --save object-assign 17 | ``` 18 | 19 | 20 | ## Usage 21 | 22 | ```js 23 | const objectAssign = require('object-assign'); 24 | 25 | objectAssign({foo: 0}, {bar: 1}); 26 | //=> {foo: 0, bar: 1} 27 | 28 | // multiple sources 29 | objectAssign({foo: 0}, {bar: 1}, {baz: 2}); 30 | //=> {foo: 0, bar: 1, baz: 2} 31 | 32 | // overwrites equal keys 33 | objectAssign({foo: 0}, {foo: 1}, {foo: 2}); 34 | //=> {foo: 2} 35 | 36 | // ignores null and undefined sources 37 | objectAssign({foo: 0}, null, {bar: 1}, undefined); 38 | //=> {foo: 0, bar: 1} 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | ### objectAssign(target, [source, ...]) 45 | 46 | Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. 47 | 48 | 49 | ## Resources 50 | 51 | - [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) 52 | 53 | 54 | ## Related 55 | 56 | - [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` 57 | 58 | 59 | ## License 60 | 61 | MIT © [Sindre Sorhus](https://sindresorhus.com) 62 | -------------------------------------------------------------------------------- /test/node_modules/object-component/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | node_modules 4 | -------------------------------------------------------------------------------- /test/node_modules/object-component/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.3 / 2012-10-15 3 | ================== 4 | 5 | * package: added `component` namespace (fixes #1) 6 | 7 | 0.0.2 / 2012-09-20 8 | ================== 9 | 10 | * add code smell to `.merge()` 11 | -------------------------------------------------------------------------------- /test/node_modules/object-component/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | test: 12 | @./node_modules/.bin/mocha \ 13 | --require should \ 14 | --reporter spec 15 | 16 | .PHONY: clean test 17 | -------------------------------------------------------------------------------- /test/node_modules/object-component/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # object 3 | 4 | Object utils. 5 | 6 | ## API 7 | 8 | ### .keys(obj) 9 | 10 | Return the keys for `obj`. 11 | 12 | ### .values(obj) 13 | 14 | Return the values for `obj`. 15 | 16 | ### .length(obj) 17 | 18 | Return the number of keys for `obj`. 19 | 20 | ### .isEmpty(obj) 21 | 22 | Check if `obj` is empty. 23 | 24 | ### .merge(a, b) 25 | 26 | Merge object `b` into `a`, returns `a`. 27 | Precedence is given to `b`. 28 | 29 | ## License 30 | 31 | MIT -------------------------------------------------------------------------------- /test/node_modules/object-component/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "object", 3 | "description": "Object keys / values / length", 4 | "version": "0.0.3", 5 | "keywords": ["object", "keys", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/node_modules/object-component/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * HOP ref. 4 | */ 5 | 6 | var has = Object.prototype.hasOwnProperty; 7 | 8 | /** 9 | * Return own keys in `obj`. 10 | * 11 | * @param {Object} obj 12 | * @return {Array} 13 | * @api public 14 | */ 15 | 16 | exports.keys = Object.keys || function(obj){ 17 | var keys = []; 18 | for (var key in obj) { 19 | if (has.call(obj, key)) { 20 | keys.push(key); 21 | } 22 | } 23 | return keys; 24 | }; 25 | 26 | /** 27 | * Return own values in `obj`. 28 | * 29 | * @param {Object} obj 30 | * @return {Array} 31 | * @api public 32 | */ 33 | 34 | exports.values = function(obj){ 35 | var vals = []; 36 | for (var key in obj) { 37 | if (has.call(obj, key)) { 38 | vals.push(obj[key]); 39 | } 40 | } 41 | return vals; 42 | }; 43 | 44 | /** 45 | * Merge `b` into `a`. 46 | * 47 | * @param {Object} a 48 | * @param {Object} b 49 | * @return {Object} a 50 | * @api public 51 | */ 52 | 53 | exports.merge = function(a, b){ 54 | for (var key in b) { 55 | if (has.call(b, key)) { 56 | a[key] = b[key]; 57 | } 58 | } 59 | return a; 60 | }; 61 | 62 | /** 63 | * Return length of `obj`. 64 | * 65 | * @param {Object} obj 66 | * @return {Number} 67 | * @api public 68 | */ 69 | 70 | exports.length = function(obj){ 71 | return exports.keys(obj).length; 72 | }; 73 | 74 | /** 75 | * Check if `obj` is empty. 76 | * 77 | * @param {Object} obj 78 | * @return {Boolean} 79 | * @api public 80 | */ 81 | 82 | exports.isEmpty = function(obj){ 83 | return 0 == exports.length(obj); 84 | }; -------------------------------------------------------------------------------- /test/node_modules/object-component/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "object-component@0.0.3", 6 | "scope": null, 7 | "escapedName": "object-component", 8 | "name": "object-component", 9 | "rawSpec": "0.0.3", 10 | "spec": "0.0.3", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "object-component@0.0.3", 17 | "_id": "object-component@0.0.3", 18 | "_inCache": true, 19 | "_location": "/object-component", 20 | "_npmUser": { 21 | "name": "tjholowaychuk", 22 | "email": "tj@vision-media.ca" 23 | }, 24 | "_npmVersion": "1.1.61", 25 | "_phantomChildren": {}, 26 | "_requested": { 27 | "raw": "object-component@0.0.3", 28 | "scope": null, 29 | "escapedName": "object-component", 30 | "name": "object-component", 31 | "rawSpec": "0.0.3", 32 | "spec": "0.0.3", 33 | "type": "version" 34 | }, 35 | "_requiredBy": [ 36 | "/socket.io-client" 37 | ], 38 | "_resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", 39 | "_shasum": "f0c69aa50efc95b866c186f400a33769cb2f1291", 40 | "_shrinkwrap": null, 41 | "_spec": "object-component@0.0.3", 42 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 43 | "component": { 44 | "scripts": { 45 | "object/index.js": "index.js" 46 | } 47 | }, 48 | "dependencies": {}, 49 | "description": "Object utils.", 50 | "devDependencies": { 51 | "mocha": "*", 52 | "should": "*" 53 | }, 54 | "directories": {}, 55 | "dist": { 56 | "shasum": "f0c69aa50efc95b866c186f400a33769cb2f1291", 57 | "tarball": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz" 58 | }, 59 | "maintainers": [ 60 | { 61 | "name": "tjholowaychuk", 62 | "email": "tj@vision-media.ca" 63 | } 64 | ], 65 | "name": "object-component", 66 | "optionalDependencies": {}, 67 | "readme": "\n# object\n\n Object utils.\n\n## API\n\n### .keys(obj)\n\n Return the keys for `obj`.\n\n### .values(obj)\n\n Return the values for `obj`.\n\n### .length(obj)\n\n Return the number of keys for `obj`.\n\n### .isEmpty(obj)\n\n Check if `obj` is empty.\n\n### .merge(a, b)\n\n Merge object `b` into `a`, returns `a`.\n Precedence is given to `b`.\n\n## License\n\n MIT", 68 | "version": "0.0.3" 69 | } 70 | -------------------------------------------------------------------------------- /test/node_modules/object-component/test/object.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var object = require('..'); 7 | 8 | describe('.keys(obj)', function(){ 9 | it('should return the keys of an object', function(){ 10 | var obj = { name: 'tobi', age: 1 }; 11 | object.keys(obj).should.eql(['name', 'age']); 12 | }) 13 | }) 14 | 15 | describe('.values(obj)', function(){ 16 | it('should return the values of an object', function(){ 17 | var obj = { name: 'tobi', age: 1 }; 18 | object.values(obj).should.eql(['tobi', 1]); 19 | }) 20 | }) 21 | 22 | describe('.length(obj)', function(){ 23 | it('should return key count', function(){ 24 | var obj = { name: 'tobi', age: 1 }; 25 | object.length(obj).should.equal(2); 26 | }) 27 | }) 28 | 29 | describe('.merge(a, b)', function(){ 30 | it('should merge two objects', function(){ 31 | var a = { foo: 'bar' }; 32 | var b = { bar: 'baz' }; 33 | object.merge(a, b).should.eql({ foo: 'bar', bar: 'baz' }); 34 | }) 35 | 36 | it('should give precedence to b', function(){ 37 | var a = { foo: 'bar' }; 38 | var b = { foo: 'baz' }; 39 | object.merge(a, b).should.eql({ foo: 'baz' }); 40 | }) 41 | }) 42 | 43 | describe('.isEmpty()', function(){ 44 | it('should check if the object is empty', function(){ 45 | object.isEmpty({}).should.be.true; 46 | object.isEmpty({ foo: 'bar' }).should.be.false; 47 | }) 48 | }) -------------------------------------------------------------------------------- /test/node_modules/parsejson/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /test/node_modules/parsejson/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Gal Koren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/parsejson/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha test.js 4 | -------------------------------------------------------------------------------- /test/node_modules/parsejson/README.md: -------------------------------------------------------------------------------- 1 | # parsejson 2 | engine.io-client JSON-parsing module 3 | -------------------------------------------------------------------------------- /test/node_modules/parsejson/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * JSON parse. 3 | * 4 | * @see Based on jQuery#parseJSON (MIT) and JSON2 5 | * @api private 6 | */ 7 | 8 | var rvalidchars = /^[\],:{}\s]*$/; 9 | var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g; 10 | var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; 11 | var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g; 12 | var rtrimLeft = /^\s+/; 13 | var rtrimRight = /\s+$/; 14 | 15 | module.exports = function parsejson(data) { 16 | if ('string' != typeof data || !data) { 17 | return null; 18 | } 19 | 20 | data = data.replace(rtrimLeft, '').replace(rtrimRight, ''); 21 | 22 | // Attempt to parse using the native JSON parser first 23 | if (global.JSON && JSON.parse) { 24 | return JSON.parse(data); 25 | } 26 | 27 | if (rvalidchars.test(data.replace(rvalidescape, '@') 28 | .replace(rvalidtokens, ']') 29 | .replace(rvalidbraces, ''))) { 30 | return (new Function('return ' + data))(); 31 | } 32 | }; -------------------------------------------------------------------------------- /test/node_modules/parsejson/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "parsejson@0.0.3", 6 | "scope": null, 7 | "escapedName": "parsejson", 8 | "name": "parsejson", 9 | "rawSpec": "0.0.3", 10 | "spec": "0.0.3", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-client" 14 | ] 15 | ], 16 | "_from": "parsejson@0.0.3", 17 | "_id": "parsejson@0.0.3", 18 | "_inCache": true, 19 | "_location": "/parsejson", 20 | "_nodeVersion": "6.9.1", 21 | "_npmOperationalInternal": { 22 | "host": "packages-12-west.internal.npmjs.com", 23 | "tmp": "tmp/parsejson-0.0.3.tgz_1477582490190_0.9499260517768562" 24 | }, 25 | "_npmUser": { 26 | "name": "gal", 27 | "email": "koren@mit.edu" 28 | }, 29 | "_npmVersion": "3.10.8", 30 | "_phantomChildren": {}, 31 | "_requested": { 32 | "raw": "parsejson@0.0.3", 33 | "scope": null, 34 | "escapedName": "parsejson", 35 | "name": "parsejson", 36 | "rawSpec": "0.0.3", 37 | "spec": "0.0.3", 38 | "type": "version" 39 | }, 40 | "_requiredBy": [ 41 | "/engine.io-client" 42 | ], 43 | "_resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", 44 | "_shasum": "ab7e3759f209ece99437973f7d0f1f64ae0e64ab", 45 | "_shrinkwrap": null, 46 | "_spec": "parsejson@0.0.3", 47 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io-client", 48 | "author": { 49 | "name": "Gal Koren" 50 | }, 51 | "bugs": { 52 | "url": "https://github.com/get/parsejson/issues" 53 | }, 54 | "dependencies": { 55 | "better-assert": "~1.0.0" 56 | }, 57 | "description": "Method that parses a JSON string and returns a JSON object", 58 | "devDependencies": { 59 | "better-assert": "~1.0.0", 60 | "mocha": "1.17.1" 61 | }, 62 | "directories": {}, 63 | "dist": { 64 | "shasum": "ab7e3759f209ece99437973f7d0f1f64ae0e64ab", 65 | "tarball": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz" 66 | }, 67 | "gitHead": "7c26d14d9a076e50f582f4d3e7472cfe36b6d930", 68 | "homepage": "https://github.com/get/parsejson", 69 | "license": "MIT", 70 | "maintainers": [ 71 | { 72 | "name": "gal", 73 | "email": "koren@mit.edu" 74 | } 75 | ], 76 | "name": "parsejson", 77 | "optionalDependencies": {}, 78 | "readme": "ERROR: No README data found!", 79 | "repository": { 80 | "type": "git", 81 | "url": "git+https://github.com/get/parsejson.git" 82 | }, 83 | "scripts": { 84 | "test": "make test" 85 | }, 86 | "version": "0.0.3" 87 | } 88 | -------------------------------------------------------------------------------- /test/node_modules/parsejson/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('better-assert'); 2 | var expect = require('expect.js'); 3 | var parsejson = require('./index.js'); 4 | 5 | describe('my suite', function(){ 6 | it('should parse a JSON string', function () { 7 | 8 | var jsonString = '{"users" :[{"first_name":"foo", "last_name":"bar"}],' + 9 | '"id" :40,' + 10 | '"cities":["los angeles", "new york", "boston"]}'; 11 | 12 | var jsonObj = parsejson(jsonString); 13 | expect(jsonObj.users[0].first_name).to.be("foo"); 14 | expect(jsonObj.users[0].last_name).to.be("bar"); 15 | expect(jsonObj.id).to.be(40); 16 | expect(jsonObj.cities[0]).to.be('los angeles'); 17 | expect(jsonObj.cities[1]).to.be('new york'); 18 | expect(jsonObj.cities[2]).to.be('boston'); 19 | 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | npm-debug.log -------------------------------------------------------------------------------- /test/node_modules/parseqs/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Gal Koren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha test.js 4 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/README.md: -------------------------------------------------------------------------------- 1 | Provides methods for converting an object into string representation, and vice versa. 2 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Compiles a querystring 3 | * Returns string representation of the object 4 | * 5 | * @param {Object} 6 | * @api private 7 | */ 8 | 9 | exports.encode = function (obj) { 10 | var str = ''; 11 | 12 | for (var i in obj) { 13 | if (obj.hasOwnProperty(i)) { 14 | if (str.length) str += '&'; 15 | str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); 16 | } 17 | } 18 | 19 | return str; 20 | }; 21 | 22 | /** 23 | * Parses a simple querystring into an object 24 | * 25 | * @param {String} qs 26 | * @api private 27 | */ 28 | 29 | exports.decode = function(qs){ 30 | var qry = {}; 31 | var pairs = qs.split('&'); 32 | for (var i = 0, l = pairs.length; i < l; i++) { 33 | var pair = pairs[i].split('='); 34 | qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); 35 | } 36 | return qry; 37 | }; 38 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "parseqs@0.0.5", 6 | "scope": null, 7 | "escapedName": "parseqs", 8 | "name": "parseqs", 9 | "rawSpec": "0.0.5", 10 | "spec": "0.0.5", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "parseqs@0.0.5", 17 | "_id": "parseqs@0.0.5", 18 | "_inCache": true, 19 | "_location": "/parseqs", 20 | "_nodeVersion": "6.9.1", 21 | "_npmOperationalInternal": { 22 | "host": "packages-18-east.internal.npmjs.com", 23 | "tmp": "tmp/parseqs-0.0.5.tgz_1477582844598_0.35737923183478415" 24 | }, 25 | "_npmUser": { 26 | "name": "gal", 27 | "email": "koren@mit.edu" 28 | }, 29 | "_npmVersion": "3.10.8", 30 | "_phantomChildren": {}, 31 | "_requested": { 32 | "raw": "parseqs@0.0.5", 33 | "scope": null, 34 | "escapedName": "parseqs", 35 | "name": "parseqs", 36 | "rawSpec": "0.0.5", 37 | "spec": "0.0.5", 38 | "type": "version" 39 | }, 40 | "_requiredBy": [ 41 | "/engine.io-client", 42 | "/socket.io-client" 43 | ], 44 | "_resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", 45 | "_shasum": "d5208a3738e46766e291ba2ea173684921a8b89d", 46 | "_shrinkwrap": null, 47 | "_spec": "parseqs@0.0.5", 48 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 49 | "author": { 50 | "name": "Gal Koren" 51 | }, 52 | "bugs": { 53 | "url": "https://github.com/get/querystring/issues" 54 | }, 55 | "dependencies": { 56 | "better-assert": "~1.0.0" 57 | }, 58 | "description": "Provides methods for parsing a query string into an object, and vice versa.", 59 | "devDependencies": { 60 | "better-assert": "~1.0.0", 61 | "mocha": "1.17.1" 62 | }, 63 | "directories": {}, 64 | "dist": { 65 | "shasum": "d5208a3738e46766e291ba2ea173684921a8b89d", 66 | "tarball": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz" 67 | }, 68 | "gitHead": "4d037fc0625fb72eec9394724e18f29e0a946af5", 69 | "homepage": "https://github.com/get/querystring", 70 | "license": "MIT", 71 | "maintainers": [ 72 | { 73 | "name": "gal", 74 | "email": "koren@mit.edu" 75 | } 76 | ], 77 | "name": "parseqs", 78 | "optionalDependencies": {}, 79 | "readme": "ERROR: No README data found!", 80 | "repository": { 81 | "type": "git", 82 | "url": "git+https://github.com/get/querystring.git" 83 | }, 84 | "scripts": { 85 | "test": "make test" 86 | }, 87 | "version": "0.0.5" 88 | } 89 | -------------------------------------------------------------------------------- /test/node_modules/parseqs/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('better-assert'); 2 | var expect = require('expect.js'); 3 | var util = require('./index.js'); 4 | 5 | describe('querystring test suite', function(){ 6 | it('should parse a querystring and return an object', function () { 7 | 8 | // Single assignment 9 | var queryObj = util.decode("foo=bar"); 10 | expect(queryObj.foo).to.be("bar"); 11 | 12 | // Multiple assignments 13 | queryObj = util.decode("france=paris&germany=berlin"); 14 | expect(queryObj.france).to.be("paris"); 15 | expect(queryObj.germany).to.be("berlin"); 16 | 17 | // Assignments containing non-alphanumeric characters 18 | queryObj = util.decode("india=new%20delhi"); 19 | expect(queryObj.india).to.be("new delhi"); 20 | }); 21 | 22 | it('should construct a query string from an object', function () { 23 | expect(util.encode({ a: 'b' })).to.be('a=b'); 24 | expect(util.encode({ a: 'b', c: 'd' })).to.be('a=b&c=d'); 25 | expect(util.encode({ a: 'b', c: 'tobi rocks' })).to.be('a=b&c=tobi%20rocks'); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .node_modules/* -------------------------------------------------------------------------------- /test/node_modules/parseuri/History.md: -------------------------------------------------------------------------------- 1 | 2 | n.n.n / 2014-02-09 3 | ================== 4 | 5 | * parseuri first commit 6 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Gal Koren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha test.js 4 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/README.md: -------------------------------------------------------------------------------- 1 | # parseuri 2 | Module for parsing URI's in engine.io-client 3 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Parses an URI 3 | * 4 | * @author Steven Levithan (MIT license) 5 | * @api private 6 | */ 7 | 8 | var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; 9 | 10 | var parts = [ 11 | 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor' 12 | ]; 13 | 14 | module.exports = function parseuri(str) { 15 | var src = str, 16 | b = str.indexOf('['), 17 | e = str.indexOf(']'); 18 | 19 | if (b != -1 && e != -1) { 20 | str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); 21 | } 22 | 23 | var m = re.exec(str || ''), 24 | uri = {}, 25 | i = 14; 26 | 27 | while (i--) { 28 | uri[parts[i]] = m[i] || ''; 29 | } 30 | 31 | if (b != -1 && e != -1) { 32 | uri.source = src; 33 | uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); 34 | uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); 35 | uri.ipv6uri = true; 36 | } 37 | 38 | return uri; 39 | }; 40 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "parseuri@0.0.5", 6 | "scope": null, 7 | "escapedName": "parseuri", 8 | "name": "parseuri", 9 | "rawSpec": "0.0.5", 10 | "spec": "0.0.5", 11 | "type": "version" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client" 14 | ] 15 | ], 16 | "_from": "parseuri@0.0.5", 17 | "_id": "parseuri@0.0.5", 18 | "_inCache": true, 19 | "_location": "/parseuri", 20 | "_nodeVersion": "6.9.1", 21 | "_npmOperationalInternal": { 22 | "host": "packages-18-east.internal.npmjs.com", 23 | "tmp": "tmp/parseuri-0.0.5.tgz_1477582137634_0.3768787120934576" 24 | }, 25 | "_npmUser": { 26 | "name": "gal", 27 | "email": "koren@mit.edu" 28 | }, 29 | "_npmVersion": "3.10.8", 30 | "_phantomChildren": {}, 31 | "_requested": { 32 | "raw": "parseuri@0.0.5", 33 | "scope": null, 34 | "escapedName": "parseuri", 35 | "name": "parseuri", 36 | "rawSpec": "0.0.5", 37 | "spec": "0.0.5", 38 | "type": "version" 39 | }, 40 | "_requiredBy": [ 41 | "/engine.io-client", 42 | "/socket.io-client" 43 | ], 44 | "_resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", 45 | "_shasum": "80204a50d4dbb779bfdc6ebe2778d90e4bce320a", 46 | "_shrinkwrap": null, 47 | "_spec": "parseuri@0.0.5", 48 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/socket.io-client", 49 | "author": "", 50 | "bugs": { 51 | "url": "https://github.com/get/parseuri/issues" 52 | }, 53 | "dependencies": { 54 | "better-assert": "~1.0.0" 55 | }, 56 | "description": "Method that parses a URI and returns an array of its components", 57 | "devDependencies": { 58 | "better-assert": "1.0.0", 59 | "mocha": "1.17.1" 60 | }, 61 | "directories": {}, 62 | "dist": { 63 | "shasum": "80204a50d4dbb779bfdc6ebe2778d90e4bce320a", 64 | "tarball": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz" 65 | }, 66 | "gitHead": "792c9a63162a4484eb6b4f95fc611ccf224a24b6", 67 | "homepage": "https://github.com/get/parseuri", 68 | "license": "MIT", 69 | "maintainers": [ 70 | { 71 | "name": "gal", 72 | "email": "koren@mit.edu" 73 | } 74 | ], 75 | "name": "parseuri", 76 | "optionalDependencies": {}, 77 | "readme": "ERROR: No README data found!", 78 | "repository": { 79 | "type": "git", 80 | "url": "git+https://github.com/get/parseuri.git" 81 | }, 82 | "scripts": { 83 | "test": "make test" 84 | }, 85 | "version": "0.0.5" 86 | } 87 | -------------------------------------------------------------------------------- /test/node_modules/parseuri/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('better-assert'); 2 | var expect = require('expect.js'); 3 | var parseuri = require('./index.js'); 4 | 5 | describe('my suite', function(){ 6 | it('should parse an uri', function () { 7 | var http = parseuri('http://google.com') 8 | , https = parseuri('https://www.google.com:80') 9 | , query = parseuri('google.com:8080/foo/bar?foo=bar') 10 | , localhost = parseuri('localhost:8080') 11 | , ipv6 = parseuri('2001:0db8:85a3:0042:1000:8a2e:0370:7334') 12 | , ipv6short = parseuri('2001:db8:85a3:42:1000:8a2e:370:7334') 13 | , ipv6port = parseuri('2001:db8:85a3:42:1000:8a2e:370:7334:80') 14 | , ipv6abbrev = parseuri('2001::7334:a:80') 15 | , ipv6http = parseuri('http://[2001::7334:a]:80') 16 | , ipv6query = parseuri('http://[2001::7334:a]:80/foo/bar?foo=bar') 17 | 18 | expect(http.protocol).to.be('http'); 19 | expect(http.port).to.be(''); 20 | expect(http.host).to.be('google.com'); 21 | expect(https.protocol).to.be('https'); 22 | expect(https.port).to.be('80'); 23 | expect(https.host).to.be('www.google.com'); 24 | expect(query.port).to.be('8080'); 25 | expect(query.query).to.be('foo=bar'); 26 | expect(query.path).to.be('/foo/bar'); 27 | expect(query.relative).to.be('/foo/bar?foo=bar'); 28 | expect(localhost.protocol).to.be(''); 29 | expect(localhost.host).to.be('localhost'); 30 | expect(localhost.port).to.be('8080'); 31 | expect(ipv6.protocol).to.be(''); 32 | expect(ipv6.host).to.be('2001:0db8:85a3:0042:1000:8a2e:0370:7334'); 33 | expect(ipv6.port).to.be(''); 34 | expect(ipv6short.protocol).to.be(''); 35 | expect(ipv6short.host).to.be('2001:db8:85a3:42:1000:8a2e:370:7334'); 36 | expect(ipv6short.port).to.be(''); 37 | expect(ipv6port.protocol).to.be(''); 38 | expect(ipv6port.host).to.be('2001:db8:85a3:42:1000:8a2e:370:7334'); 39 | expect(ipv6port.port).to.be('80'); 40 | expect(ipv6abbrev.protocol).to.be(''); 41 | expect(ipv6abbrev.host).to.be('2001::7334:a:80'); 42 | expect(ipv6abbrev.port).to.be(''); 43 | expect(ipv6http.protocol).to.be('http'); 44 | expect(ipv6http.port).to.be('80'); 45 | expect(ipv6http.host).to.be('2001::7334:a'); 46 | expect(ipv6query.protocol).to.be('http'); 47 | expect(ipv6query.port).to.be('80'); 48 | expect(ipv6query.host).to.be('2001::7334:a'); 49 | expect(ipv6query.relative).to.be('/foo/bar?foo=bar'); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /test/node_modules/safe-buffer/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 'node' 4 | - '5' 5 | - '4' 6 | - '0.12' 7 | - '0.10' 8 | -------------------------------------------------------------------------------- /test/node_modules/safe-buffer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Feross Aboukhadijeh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/safe-buffer/browser.js: -------------------------------------------------------------------------------- 1 | module.exports = require('buffer') 2 | -------------------------------------------------------------------------------- /test/node_modules/safe-buffer/index.js: -------------------------------------------------------------------------------- 1 | var buffer = require('buffer') 2 | 3 | if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { 4 | module.exports = buffer 5 | } else { 6 | // Copy properties from require('buffer') 7 | Object.keys(buffer).forEach(function (prop) { 8 | exports[prop] = buffer[prop] 9 | }) 10 | exports.Buffer = SafeBuffer 11 | } 12 | 13 | function SafeBuffer (arg, encodingOrOffset, length) { 14 | return Buffer(arg, encodingOrOffset, length) 15 | } 16 | 17 | // Copy static methods from Buffer 18 | Object.keys(Buffer).forEach(function (prop) { 19 | SafeBuffer[prop] = Buffer[prop] 20 | }) 21 | 22 | SafeBuffer.from = function (arg, encodingOrOffset, length) { 23 | if (typeof arg === 'number') { 24 | throw new TypeError('Argument must not be a number') 25 | } 26 | return Buffer(arg, encodingOrOffset, length) 27 | } 28 | 29 | SafeBuffer.alloc = function (size, fill, encoding) { 30 | if (typeof size !== 'number') { 31 | throw new TypeError('Argument must be a number') 32 | } 33 | var buf = Buffer(size) 34 | if (fill !== undefined) { 35 | if (typeof encoding === 'string') { 36 | buf.fill(fill, encoding) 37 | } else { 38 | buf.fill(fill) 39 | } 40 | } else { 41 | buf.fill(0) 42 | } 43 | return buf 44 | } 45 | 46 | SafeBuffer.allocUnsafe = function (size) { 47 | if (typeof size !== 'number') { 48 | throw new TypeError('Argument must be a number') 49 | } 50 | return Buffer(size) 51 | } 52 | 53 | SafeBuffer.allocUnsafeSlow = function (size) { 54 | if (typeof size !== 'number') { 55 | throw new TypeError('Argument must be a number') 56 | } 57 | return buffer.SlowBuffer(size) 58 | } 59 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.1.0 / 2017-02-26 3 | =================== 4 | 5 | * [feat] Add addAll method (#49) 6 | 7 | 1.0.0 / 2017-02-16 8 | =================== 9 | 10 | * [feat] Remove the socket.io-parser dependency (#47) 11 | * [refactor] Remove useless self var (#45) 12 | 13 | The major bump is due to #45, which is only compatible with socket.io > 2.0. 14 | 15 | 0.5.0 / 2016-11-20 16 | ================== 17 | 18 | * [docs] Fix typo in Readme.md (#37) 19 | * [chore] Bump socket.io-parser to version 2.3.1 (#43) 20 | * [chore] Bump debug to version 2.3.3 (#42) 21 | * [feature] Add clientRooms method (#41) 22 | 23 | 0.4.0 / 2015-12-03 24 | ================== 25 | 26 | * package: bump `debug` 27 | * use a `Room` class to efficiently track room size 28 | * allow `clients(fn)` 29 | * call the callback on `delAll` 30 | 31 | 0.3.1 / 2014-10-27 32 | ================== 33 | 34 | * bump parser version 35 | * fix room autopruning 36 | * add autoprunning of empty rooms 37 | * rooms are now created as objects 38 | * added the repository field. 39 | * updated the debug dependency. 40 | 41 | 0.3.0 / 2014-05-30 42 | ================== 43 | 44 | * bump `socket.io-parser` for binary ack fix 45 | 46 | 0.2.0 / 2014-03-14 47 | ================== 48 | 49 | * upgraded faster parser 50 | 51 | 0.1.0 / 2014-03-07 52 | ================== 53 | 54 | * initial commit 55 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the 'Software'), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # socket.io-adapter 3 | 4 | Default socket.io in-memory adapter class. 5 | 6 | ## How to use 7 | 8 | This module is not intended for end-user usage, but can be used as an 9 | interface to inherit from from other adapters you might want to build. 10 | 11 | As an example of an adapter that builds on top of this, please take a look 12 | at [socket.io-redis](https://github.com/learnboost/socket.io-redis). 13 | 14 | ## License 15 | 16 | MIT 17 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | yarn.lock 8 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | and associated documentation files (the 'Software'), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 3 | THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) 4 | THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) 5 | 6 | # BIN directory 7 | BIN := $(THIS_DIR)/node_modules/.bin 8 | 9 | # applications 10 | NODE ?= $(shell which node) 11 | YARN ?= $(shell which yarn) 12 | PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) 13 | BROWSERIFY ?= $(NODE) $(BIN)/browserify 14 | 15 | all: dist/debug.js 16 | 17 | install: node_modules 18 | 19 | clean: 20 | @rm -rf dist 21 | 22 | dist: 23 | @mkdir -p $@ 24 | 25 | dist/debug.js: node_modules browser.js debug.js dist 26 | @$(BROWSERIFY) \ 27 | --standalone debug \ 28 | . > $@ 29 | 30 | distclean: clean 31 | @rm -rf node_modules 32 | 33 | node_modules: package.json 34 | @NODE_ENV= $(PKG) install 35 | @touch node_modules 36 | 37 | .PHONY: all install clean distclean 38 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "homepage": "https://github.com/visionmedia/debug", 5 | "authors": [ 6 | "TJ Holowaychuk ", 7 | "Nathan Rajlich (http://n8.io)", 8 | "Andrew Rhyne " 9 | ], 10 | "description": "visionmedia-debug", 11 | "moduleType": [ 12 | "amd", 13 | "es6", 14 | "globals", 15 | "node" 16 | ], 17 | "keywords": [ 18 | "visionmedia", 19 | "debug" 20 | ], 21 | "license": "MIT", 22 | "ignore": [ 23 | "**/.*", 24 | "node_modules", 25 | "bower_components", 26 | "test", 27 | "tests" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.3.3", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/debug/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Detect Electron renderer process, which is node, but we should 3 | * treat as a browser. 4 | */ 5 | 6 | if (typeof process !== 'undefined' && process.type === 'renderer') { 7 | module.exports = require('./browser.js'); 8 | } else { 9 | module.exports = require('./node.js'); 10 | } 11 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/ms/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Zeit, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-adapter/node_modules/ms/README.md: -------------------------------------------------------------------------------- 1 | # ms 2 | 3 | [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) 4 | [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) 5 | [![Slack Channel](https://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) 6 | 7 | Use this package to easily convert various time formats to milliseconds. 8 | 9 | ## Examples 10 | 11 | ```js 12 | ms('2 days') // 172800000 13 | ms('1d') // 86400000 14 | ms('10h') // 36000000 15 | ms('2.5 hrs') // 9000000 16 | ms('2h') // 7200000 17 | ms('1m') // 60000 18 | ms('5s') // 5000 19 | ms('1y') // 31557600000 20 | ms('100') // 100 21 | ``` 22 | 23 | ### Convert from milliseconds 24 | 25 | ```js 26 | ms(60000) // "1m" 27 | ms(2 * 60000) // "2m" 28 | ms(ms('10 hours')) // "10h" 29 | ``` 30 | 31 | ### Time format written-out 32 | 33 | ```js 34 | ms(60000, { long: true }) // "1 minute" 35 | ms(2 * 60000, { long: true }) // "2 minutes" 36 | ms(ms('10 hours'), { long: true }) // "10 hours" 37 | ``` 38 | 39 | ## Features 40 | 41 | - Works both in [node](https://nodejs.org) and in the browser. 42 | - If a number is supplied to `ms`, a string with a unit is returned. 43 | - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). 44 | - If you pass a string with a number and a valid unit, the number of equivalent ms is returned. 45 | 46 | ## Caught a bug? 47 | 48 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 49 | 2. Link the package to the global module directory: `npm link` 50 | 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! 51 | 52 | As always, you can run the tests using: `npm test` 53 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-client/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /test/node_modules/socket.io-client/README.md: -------------------------------------------------------------------------------- 1 | 2 | # socket.io-client 3 | 4 | [![Build Status](https://secure.travis-ci.org/socketio/socket.io-client.svg?branch=master)](http://travis-ci.org/socketio/socket.io-client) 5 | [![Dependency Status](https://david-dm.org/socketio/socket.io-client.svg)](https://david-dm.org/socketio/socket.io-client) 6 | [![devDependency Status](https://david-dm.org/socketio/socket.io-client/dev-status.svg)](https://david-dm.org/socketio/socket.io-client#info=devDependencies) 7 | ![NPM version](https://badge.fury.io/js/socket.io-client.svg) 8 | ![Downloads](http://img.shields.io/npm/dm/socket.io-client.svg?style=flat) 9 | [![](http://slack.socket.io/badge.svg?)](http://slack.socket.io) 10 | 11 | [![Sauce Test Status](https://saucelabs.com/browser-matrix/socket.svg)](https://saucelabs.com/u/socket) 12 | 13 | ## How to use 14 | 15 | A standalone build of `socket.io-client` is exposed automatically by the 16 | socket.io server as `/socket.io/socket.io.js`. Alternatively you can 17 | serve the file `socket.io.js` found in the `dist` folder. 18 | 19 | ```html 20 | 21 | 27 | ``` 28 | 29 | A slim build (without `JSON3`, a JSON polyfill for IE6/IE7, and `debug`) is also available: `socket.io.slim.js`. 30 | 31 | Socket.IO is compatible with [browserify](http://browserify.org/). 32 | 33 | ### Node.JS (server-side usage) 34 | 35 | Add `socket.io-client` to your `package.json` and then: 36 | 37 | ```js 38 | var socket = require('socket.io-client')('http://localhost'); 39 | socket.on('connect', function(){}); 40 | socket.on('event', function(data){}); 41 | socket.on('disconnect', function(){}); 42 | ``` 43 | 44 | ## API 45 | 46 | See [API](/docs/API.md) 47 | 48 | ## License 49 | 50 | [MIT](/LICENSE) 51 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-client/lib/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var url = require('./url'); 7 | var parser = require('socket.io-parser'); 8 | var Manager = require('./manager'); 9 | var debug = require('debug')('socket.io-client'); 10 | 11 | /** 12 | * Module exports. 13 | */ 14 | 15 | module.exports = exports = lookup; 16 | 17 | /** 18 | * Managers cache. 19 | */ 20 | 21 | var cache = exports.managers = {}; 22 | 23 | /** 24 | * Looks up an existing `Manager` for multiplexing. 25 | * If the user summons: 26 | * 27 | * `io('http://localhost/a');` 28 | * `io('http://localhost/b');` 29 | * 30 | * We reuse the existing instance based on same scheme/port/host, 31 | * and we initialize sockets for each namespace. 32 | * 33 | * @api public 34 | */ 35 | 36 | function lookup (uri, opts) { 37 | if (typeof uri === 'object') { 38 | opts = uri; 39 | uri = undefined; 40 | } 41 | 42 | opts = opts || {}; 43 | 44 | var parsed = url(uri); 45 | var source = parsed.source; 46 | var id = parsed.id; 47 | var path = parsed.path; 48 | var sameNamespace = cache[id] && path in cache[id].nsps; 49 | var newConnection = opts.forceNew || opts['force new connection'] || 50 | false === opts.multiplex || sameNamespace; 51 | 52 | var io; 53 | 54 | if (newConnection) { 55 | debug('ignoring socket cache for %s', source); 56 | io = Manager(source, opts); 57 | } else { 58 | if (!cache[id]) { 59 | debug('new io instance for %s', source); 60 | cache[id] = Manager(source, opts); 61 | } 62 | io = cache[id]; 63 | } 64 | if (parsed.query && !opts.query) { 65 | opts.query = parsed.query; 66 | } 67 | return io.socket(parsed.path, opts); 68 | } 69 | 70 | /** 71 | * Protocol version. 72 | * 73 | * @api public 74 | */ 75 | 76 | exports.protocol = parser.protocol; 77 | 78 | /** 79 | * `connect`. 80 | * 81 | * @param {String} uri 82 | * @api public 83 | */ 84 | 85 | exports.connect = lookup; 86 | 87 | /** 88 | * Expose constructors for standalone build. 89 | * 90 | * @api public 91 | */ 92 | 93 | exports.Manager = require('./manager'); 94 | exports.Socket = require('./socket'); 95 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-client/lib/on.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module exports. 4 | */ 5 | 6 | module.exports = on; 7 | 8 | /** 9 | * Helper for subscriptions. 10 | * 11 | * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter` 12 | * @param {String} event name 13 | * @param {Function} callback 14 | * @api public 15 | */ 16 | 17 | function on (obj, ev, fn) { 18 | obj.on(ev, fn); 19 | return { 20 | destroy: function () { 21 | obj.removeListener(ev, fn); 22 | } 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-client/lib/url.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var parseuri = require('parseuri'); 7 | var debug = require('debug')('socket.io-client:url'); 8 | 9 | /** 10 | * Module exports. 11 | */ 12 | 13 | module.exports = url; 14 | 15 | /** 16 | * URL parser. 17 | * 18 | * @param {String} url 19 | * @param {Object} An object meant to mimic window.location. 20 | * Defaults to window.location. 21 | * @api public 22 | */ 23 | 24 | function url (uri, loc) { 25 | var obj = uri; 26 | 27 | // default to window.location 28 | loc = loc || global.location; 29 | if (null == uri) uri = loc.protocol + '//' + loc.host; 30 | 31 | // relative path support 32 | if ('string' === typeof uri) { 33 | if ('/' === uri.charAt(0)) { 34 | if ('/' === uri.charAt(1)) { 35 | uri = loc.protocol + uri; 36 | } else { 37 | uri = loc.host + uri; 38 | } 39 | } 40 | 41 | if (!/^(https?|wss?):\/\//.test(uri)) { 42 | debug('protocol-less url %s', uri); 43 | if ('undefined' !== typeof loc) { 44 | uri = loc.protocol + '//' + uri; 45 | } else { 46 | uri = 'https://' + uri; 47 | } 48 | } 49 | 50 | // parse 51 | debug('parse %s', uri); 52 | obj = parseuri(uri); 53 | } 54 | 55 | // make sure we treat `localhost:80` and `localhost` equally 56 | if (!obj.port) { 57 | if (/^(http|ws)$/.test(obj.protocol)) { 58 | obj.port = '80'; 59 | } else if (/^(http|ws)s$/.test(obj.protocol)) { 60 | obj.port = '443'; 61 | } 62 | } 63 | 64 | obj.path = obj.path || '/'; 65 | 66 | var ipv6 = obj.host.indexOf(':') !== -1; 67 | var host = ipv6 ? '[' + obj.host + ']' : obj.host; 68 | 69 | // define unique id 70 | obj.id = obj.protocol + '://' + host + ':' + obj.port; 71 | // define href 72 | obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port)); 73 | 74 | return obj; 75 | } 76 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-parser/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the 'Software'), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-parser/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # socket.io-parser 3 | 4 | [![Build Status](https://secure.travis-ci.org/socketio/socket.io-parser.svg?branch=master)](http://travis-ci.org/socketio/socket.io-parser) 5 | [![NPM version](https://badge.fury.io/js/socket.io-parser.svg)](http://badge.fury.io/js/socket.io-parser) 6 | 7 | A socket.io encoder and decoder written in JavaScript complying with version `3` 8 | of [socket.io-protocol](https://github.com/socketio/socket.io-protocol). 9 | Used by [socket.io](https://github.com/automattic/socket.io) and 10 | [socket.io-client](https://github.com/automattic/socket.io-client). 11 | 12 | ## Parser API 13 | 14 | socket.io-parser is the reference implementation of socket.io-protocol. Read 15 | the full API here: 16 | [socket.io-protocol](https://github.com/learnboost/socket.io-protocol). 17 | 18 | ## Example Usage 19 | 20 | ### Encoding and decoding a packet 21 | 22 | ```js 23 | var parser = require('socket.io-parser'); 24 | var encoder = new parser.Encoder(); 25 | var packet = { 26 | type: parser.EVENT, 27 | data: 'test-packet', 28 | id: 13 29 | }; 30 | encoder.encode(packet, function(encodedPackets) { 31 | var decoder = new parser.Decoder(); 32 | decoder.on('decoded', function(decodedPacket) { 33 | // decodedPacket.type == parser.EVENT 34 | // decodedPacket.data == 'test-packet' 35 | // decodedPacket.id == 13 36 | }); 37 | 38 | for (var i = 0; i < encodedPackets.length; i++) { 39 | decoder.add(encodedPackets[i]); 40 | } 41 | }); 42 | ``` 43 | 44 | ### Encoding and decoding a packet with binary data 45 | 46 | ```js 47 | var parser = require('socket.io-parser'); 48 | var encoder = new parser.Encoder(); 49 | var packet = { 50 | type: parser.BINARY_EVENT, 51 | data: {i: new Buffer(1234), j: new Blob([new ArrayBuffer(2)])} 52 | id: 15 53 | }; 54 | encoder.encode(packet, function(encodedPackets) { 55 | var decoder = new parser.Decoder(); 56 | decoder.on('decoded', function(decodedPacket) { 57 | // decodedPacket.type == parser.BINARY_EVENTEVENT 58 | // Buffer.isBuffer(decodedPacket.data.i) == true 59 | // Buffer.isBuffer(decodedPacket.data.j) == true 60 | // decodedPacket.id == 15 61 | }); 62 | 63 | for (var i = 0; i < encodedPackets.length; i++) { 64 | decoder.add(encodedPackets[i]); 65 | } 66 | }); 67 | ``` 68 | See the test suite for more examples of how socket.io-parser is used. 69 | 70 | 71 | ## License 72 | 73 | MIT 74 | -------------------------------------------------------------------------------- /test/node_modules/socket.io-parser/is-buffer.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = isBuf; 3 | 4 | /** 5 | * Returns true if obj is a buffer or an arraybuffer. 6 | * 7 | * @api private 8 | */ 9 | 10 | function isBuf(obj) { 11 | return (global.Buffer && global.Buffer.isBuffer(obj)) || 12 | (global.ArrayBuffer && obj instanceof ArrayBuffer); 13 | } 14 | -------------------------------------------------------------------------------- /test/node_modules/socket.io/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2017 Automattic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/to-array/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | *.err -------------------------------------------------------------------------------- /test/node_modules/to-array/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Raynos. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /test/node_modules/to-array/README.md: -------------------------------------------------------------------------------- 1 | # to-array 2 | 3 | Turn an array like into an array 4 | 5 | ## Example 6 | 7 | ``` js 8 | var toArray = require("to-array") 9 | , elems = document.links 10 | 11 | var array = toArray(elems) 12 | ``` 13 | 14 | ## Installation 15 | 16 | `npm install to-array` 17 | 18 | ## Contributors 19 | 20 | - Raynos 21 | 22 | ## MIT Licenced 23 | -------------------------------------------------------------------------------- /test/node_modules/to-array/index.js: -------------------------------------------------------------------------------- 1 | module.exports = toArray 2 | 3 | function toArray(list, index) { 4 | var array = [] 5 | 6 | index = index || 0 7 | 8 | for (var i = index || 0; i < list.length; i++) { 9 | array[i - index] = list[i] 10 | } 11 | 12 | return array 13 | } 14 | -------------------------------------------------------------------------------- /test/node_modules/ultron/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /test/node_modules/uws/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Alex Hultman and contributors 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgement in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | -------------------------------------------------------------------------------- /test/node_modules/uws/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | `uws` tries to mimic `ws` as closely as possible without sacrificing too much performance. In most cases you simply swap `require('ws')` with `require('uws')`: 3 | 4 | ```javascript 5 | var WebSocketServer = require('uws').Server; 6 | var wss = new WebSocketServer({ port: 3000 }); 7 | 8 | function onMessage(message) { 9 | console.log('received: ' + message); 10 | } 11 | 12 | wss.on('connection', function(ws) { 13 | ws.on('message', onMessage); 14 | ws.send('something'); 15 | }); 16 | ``` 17 | 18 | ##### Deviations from ws 19 | There are some important incompatibilities with `ws` though, we aim to be ~90% compatible but will never implement behavior that is deemed too inefficient: 20 | 21 | * Binary data is passed zero-copy as an `ArrayBuffer`. This means you need to copy it to keep it past the callback. It also means you need to convert it with `Buffer.from(message)` if you expect a `Node.js Buffer`. 22 | * `webSocket._socket` is not a `net.Socket`, it is just a getter function with very basic functionalities. 23 | * `webSocket._socket.remote...` might fail, you need to cache it at connection. 24 | * `webSocket` acts like an `EventEmitter` with one listener per event maximum. 25 | * `webSocket.upgradeReq` is only valid during execution of the connection handler. If you want to keep properties of the upgradeReq for the entire lifetime of the webSocket you better attach that specific property to the webSocket at connection. 26 | 27 | ## Installation 28 | [![](https://nodei.co/npm/uws.png)](https://www.npmjs.com/package/uws) 29 | 30 | At installation `uws` will try to recompile itself using the system's C++11 compiler (GCC 4.8+, Clang 3.3, VC++ 2015+). 31 | If this fails it will silently fall back to using the precompiled binaries. 32 | NPM installation will never fail but `require('uws')` will throw if it cannot properly load the binary module. 33 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/.deps/Release/obj.target/action_after_build.stamp.d: -------------------------------------------------------------------------------- 1 | cmd_Release/obj.target/action_after_build.stamp := touch Release/obj.target/action_after_build.stamp 2 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Extensions.o.d: -------------------------------------------------------------------------------- 1 | cmd_Release/obj.target/uws/src/Extensions.o := c++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/mac/.node-gyp/7.7.1/include/node -I/Users/mac/.node-gyp/7.7.1/src -I/Users/mac/.node-gyp/7.7.1/deps/uv/include -I/Users/mac/.node-gyp/7.7.1/deps/v8/include -O3 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Extensions.o.d.raw -c -o Release/obj.target/uws/src/Extensions.o ../src/Extensions.cpp 2 | Release/obj.target/uws/src/Extensions.o: ../src/Extensions.cpp \ 3 | ../src/Extensions.h 4 | ../src/Extensions.cpp: 5 | ../src/Extensions.h: 6 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/.deps/Release/uws.node.d: -------------------------------------------------------------------------------- 1 | cmd_Release/uws.node := c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++ -o Release/uws.node Release/obj.target/uws/src/Extensions.o Release/obj.target/uws/src/Group.o Release/obj.target/uws/src/Networking.o Release/obj.target/uws/src/Hub.o Release/obj.target/uws/src/Node.o Release/obj.target/uws/src/WebSocket.o Release/obj.target/uws/src/HTTPSocket.o Release/obj.target/uws/src/Socket.o Release/obj.target/uws/src/addon.o 2 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/.deps/uws.d: -------------------------------------------------------------------------------- 1 | cmd_uws := LD_LIBRARY_PATH=/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/uws/build/Release/lib.host:/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/uws/build/Release/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; cp "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/uws/build/Release/uws.node" uws_darwin_51.node 2 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/action_after_build.stamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/action_after_build.stamp -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Group.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Group.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Hub.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Hub.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Networking.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Networking.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Node.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Node.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/Socket.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/Socket.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/obj.target/uws/src/addon.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/obj.target/uws/src/addon.o -------------------------------------------------------------------------------- /test/node_modules/uws/build/Release/uws.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/build/Release/uws.node -------------------------------------------------------------------------------- /test/node_modules/uws/build/action_after_build.target.mk: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | TOOLSET := target 4 | TARGET := action_after_build 5 | ### Rules for action "move_lib": 6 | quiet_cmd_binding_gyp_action_after_build_target_move_lib = ACTION binding_gyp_action_after_build_target_move_lib $@ 7 | cmd_binding_gyp_action_after_build_target_move_lib = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd $(srcdir)/.; cp "$(builddir)/uws.node" uws_darwin_51.node 8 | 9 | uws: obj := $(abs_obj) 10 | uws: builddir := $(abs_builddir) 11 | uws: export BUILT_FRAMEWORKS_DIR := ${abs_builddir} 12 | uws: export BUILT_PRODUCTS_DIR := ${abs_builddir} 13 | uws: export CONFIGURATION := ${BUILDTYPE} 14 | uws: export PRODUCT_NAME := action_after_build 15 | uws: export SDKROOT := 16 | uws: export SRCROOT := ${abs_srcdir}/ 17 | uws: export SOURCE_ROOT := ${SRCROOT} 18 | uws: export TARGET_BUILD_DIR := ${abs_builddir} 19 | uws: export TEMP_DIR := ${TMPDIR} 20 | uws: TOOLSET := $(TOOLSET) 21 | uws: $(builddir)/uws.node FORCE_DO_CMD 22 | $(call do_cmd,binding_gyp_action_after_build_target_move_lib) 23 | 24 | all_deps += uws 25 | action_binding_gyp_action_after_build_target_move_lib_outputs := uws 26 | 27 | 28 | ### Rules for final target. 29 | # Build our special outputs first. 30 | $(obj).target/action_after_build.stamp: | $(action_binding_gyp_action_after_build_target_move_lib_outputs) 31 | 32 | # Preserve order dependency of special output on deps. 33 | $(action_binding_gyp_action_after_build_target_move_lib_outputs): | $(builddir)/uws.node 34 | 35 | $(obj).target/action_after_build.stamp: TOOLSET := $(TOOLSET) 36 | $(obj).target/action_after_build.stamp: $(builddir)/uws.node FORCE_DO_CMD 37 | $(call do_cmd,touch) 38 | 39 | all_deps += $(obj).target/action_after_build.stamp 40 | # Add target alias 41 | .PHONY: action_after_build 42 | action_after_build: $(obj).target/action_after_build.stamp 43 | 44 | # Add target alias to "all" target. 45 | .PHONY: all 46 | all: action_after_build 47 | 48 | -------------------------------------------------------------------------------- /test/node_modules/uws/build/binding.Makefile: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | export builddir_name ?= ./build/. 4 | .PHONY: all 5 | all: 6 | $(MAKE) uws action_after_build 7 | -------------------------------------------------------------------------------- /test/node_modules/uws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | { 5 | "raw": "uws@~0.14.4", 6 | "scope": null, 7 | "escapedName": "uws", 8 | "name": "uws", 9 | "rawSpec": "~0.14.4", 10 | "spec": ">=0.14.4 <0.15.0", 11 | "type": "range" 12 | }, 13 | "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io" 14 | ] 15 | ], 16 | "_from": "uws@>=0.14.4 <0.15.0", 17 | "_id": "uws@0.14.5", 18 | "_inCache": true, 19 | "_location": "/uws", 20 | "_nodeVersion": "5.11.0", 21 | "_npmOperationalInternal": { 22 | "host": "packages-18-east.internal.npmjs.com", 23 | "tmp": "tmp/uws-0.14.5.tgz_1493399064525_0.939868062036112" 24 | }, 25 | "_npmUser": { 26 | "name": "alexhultman", 27 | "email": "alexhultman@gmail.com" 28 | }, 29 | "_npmVersion": "3.8.6", 30 | "_phantomChildren": {}, 31 | "_requested": { 32 | "raw": "uws@~0.14.4", 33 | "scope": null, 34 | "escapedName": "uws", 35 | "name": "uws", 36 | "rawSpec": "~0.14.4", 37 | "spec": ">=0.14.4 <0.15.0", 38 | "type": "range" 39 | }, 40 | "_requiredBy": [ 41 | "/engine.io" 42 | ], 43 | "_resolved": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz", 44 | "_shasum": "67aaf33c46b2a587a5f6666d00f7691328f149dc", 45 | "_shrinkwrap": null, 46 | "_spec": "uws@~0.14.4", 47 | "_where": "/Users/mac/Documents/htdocs/php_socket_client2/test/node_modules/engine.io", 48 | "author": { 49 | "name": "Alex Hultman", 50 | "email": "alexhultman@gmail.com", 51 | "url": "https://github.com/alexhultman" 52 | }, 53 | "bugs": { 54 | "url": "https://github.com/uWebSockets/uWebSockets/issues" 55 | }, 56 | "dependencies": {}, 57 | "description": "Tiny WebSockets", 58 | "devDependencies": {}, 59 | "directories": {}, 60 | "dist": { 61 | "shasum": "67aaf33c46b2a587a5f6666d00f7691328f149dc", 62 | "tarball": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz" 63 | }, 64 | "engines": { 65 | "node": ">=4" 66 | }, 67 | "homepage": "https://github.com/uWebSockets/uWebSockets", 68 | "keywords": [ 69 | "tiny", 70 | "websockets" 71 | ], 72 | "license": "Zlib", 73 | "main": "uws.js", 74 | "maintainers": [ 75 | { 76 | "name": "alexhultman", 77 | "email": "alexhultman@gmail.com" 78 | } 79 | ], 80 | "name": "uws", 81 | "optionalDependencies": {}, 82 | "readme": "ERROR: No README data found!", 83 | "repository": { 84 | "type": "git", 85 | "url": "git+https://github.com/uWebSockets/uWebSockets.git" 86 | }, 87 | "scripts": { 88 | "install": "node-gyp rebuild > build_log.txt 2>&1 || exit 0" 89 | }, 90 | "version": "0.14.5" 91 | } 92 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/Backend.h: -------------------------------------------------------------------------------- 1 | #ifndef BACKEND_H 2 | #define BACKEND_H 3 | 4 | // Default to Epoll if nothing specified and on Linux 5 | // Default to Libuv if nothing specified and not on Linux 6 | #ifdef USE_ASIO 7 | #include "Asio.h" 8 | #elif !defined(__linux__) || defined(USE_LIBUV) 9 | #include "Libuv.h" 10 | #else 11 | #define USE_EPOLL 12 | #include "Epoll.h" 13 | #endif 14 | 15 | #endif // BACKEND_H 16 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/Epoll.cpp: -------------------------------------------------------------------------------- 1 | #include "Backend.h" 2 | 3 | #ifdef USE_EPOLL 4 | 5 | // todo: remove this mutex, have callbacks set at program start 6 | std::recursive_mutex cbMutex; 7 | void (*callbacks[16])(Poll *, int, int); 8 | int cbHead = 0; 9 | 10 | void Loop::run() { 11 | timepoint = std::chrono::system_clock::now(); 12 | while (numPolls) { 13 | for (std::pair c : closing) { 14 | numPolls--; 15 | 16 | c.second(c.first); 17 | 18 | if (!numPolls) { 19 | closing.clear(); 20 | return; 21 | } 22 | } 23 | closing.clear(); 24 | 25 | int numFdReady = epoll_wait(epfd, readyEvents, 1024, delay); 26 | timepoint = std::chrono::system_clock::now(); 27 | 28 | if (preCb) { 29 | preCb(preCbData); 30 | } 31 | 32 | for (int i = 0; i < numFdReady; i++) { 33 | Poll *poll = (Poll *) readyEvents[i].data.ptr; 34 | int status = -bool(readyEvents[i].events & EPOLLERR); 35 | callbacks[poll->state.cbIndex](poll, status, readyEvents[i].events); 36 | } 37 | 38 | while (timers.size() && timers[0].timepoint < timepoint) { 39 | Timer *timer = timers[0].timer; 40 | cancelledLastTimer = false; 41 | timers[0].cb(timers[0].timer); 42 | 43 | if (cancelledLastTimer) { 44 | continue; 45 | } 46 | 47 | int repeat = timers[0].nextDelay; 48 | auto cb = timers[0].cb; 49 | timers.erase(timers.begin()); 50 | if (repeat) { 51 | timer->start(cb, repeat, repeat); 52 | } 53 | } 54 | 55 | if (postCb) { 56 | postCb(postCbData); 57 | } 58 | } 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/Extensions.h: -------------------------------------------------------------------------------- 1 | #ifndef EXTENSIONS_UWS_H 2 | #define EXTENSIONS_UWS_H 3 | 4 | #include 5 | 6 | namespace uWS { 7 | 8 | enum Options : unsigned int { 9 | NO_OPTIONS = 0, 10 | PERMESSAGE_DEFLATE = 1, 11 | SERVER_NO_CONTEXT_TAKEOVER = 2, 12 | CLIENT_NO_CONTEXT_TAKEOVER = 4, 13 | NO_DELAY = 8 14 | }; 15 | 16 | template 17 | class ExtensionsNegotiator { 18 | private: 19 | int options; 20 | public: 21 | ExtensionsNegotiator(int wantedOptions); 22 | std::string generateOffer(); 23 | void readOffer(std::string offer); 24 | int getNegotiatedOptions(); 25 | }; 26 | 27 | } 28 | 29 | #endif // EXTENSIONS_UWS_H 30 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/Networking.cpp: -------------------------------------------------------------------------------- 1 | #include "Networking.h" 2 | 3 | namespace uS { 4 | 5 | namespace TLS { 6 | 7 | Context::Context(const Context &other) 8 | { 9 | if (other.context) { 10 | context = other.context; 11 | SSL_CTX_up_ref(context); 12 | } 13 | } 14 | 15 | Context &Context::operator=(const Context &other) { 16 | if (other.context) { 17 | context = other.context; 18 | SSL_CTX_up_ref(context); 19 | } 20 | return *this; 21 | } 22 | 23 | Context::~Context() 24 | { 25 | if (context) { 26 | SSL_CTX_free(context); 27 | } 28 | } 29 | 30 | struct Init { 31 | Init() {SSL_library_init();} 32 | ~Init() {/*EVP_cleanup();*/} 33 | } init; 34 | 35 | Context createContext(std::string certChainFileName, std::string keyFileName, std::string keyFilePassword) 36 | { 37 | Context context(SSL_CTX_new(SSLv23_server_method())); 38 | if (!context.context) { 39 | return nullptr; 40 | } 41 | 42 | if (keyFilePassword.length()) { 43 | context.password.reset(new std::string(keyFilePassword)); 44 | SSL_CTX_set_default_passwd_cb_userdata(context.context, context.password.get()); 45 | SSL_CTX_set_default_passwd_cb(context.context, Context::passwordCallback); 46 | } 47 | 48 | SSL_CTX_set_options(context.context, SSL_OP_NO_SSLv3); 49 | 50 | if (SSL_CTX_use_certificate_chain_file(context.context, certChainFileName.c_str()) != 1) { 51 | return nullptr; 52 | } else if (SSL_CTX_use_PrivateKey_file(context.context, keyFileName.c_str(), SSL_FILETYPE_PEM) != 1) { 53 | return nullptr; 54 | } 55 | 56 | return context; 57 | } 58 | 59 | } 60 | 61 | #ifndef _WIN32 62 | struct Init { 63 | Init() {signal(SIGPIPE, SIG_IGN);} 64 | } init; 65 | #endif 66 | 67 | #ifdef _WIN32 68 | #pragma comment(lib, "Ws2_32.lib") 69 | 70 | struct WindowsInit { 71 | WSADATA wsaData; 72 | WindowsInit() {WSAStartup(MAKEWORD(2, 2), &wsaData);} 73 | ~WindowsInit() {WSACleanup();} 74 | } windowsInit; 75 | 76 | #endif 77 | 78 | } 79 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/Socket.cpp: -------------------------------------------------------------------------------- 1 | #include "Socket.h" 2 | 3 | namespace uS { 4 | 5 | Socket::Address Socket::getAddress() 6 | { 7 | uv_os_sock_t fd = getFd(); 8 | 9 | sockaddr_storage addr; 10 | socklen_t addrLength = sizeof(addr); 11 | if (getpeername(fd, (sockaddr *) &addr, &addrLength) == -1) { 12 | return {0, "", ""}; 13 | } 14 | 15 | static __thread char buf[INET6_ADDRSTRLEN]; 16 | 17 | if (addr.ss_family == AF_INET) { 18 | sockaddr_in *ipv4 = (sockaddr_in *) &addr; 19 | inet_ntop(AF_INET, &ipv4->sin_addr, buf, sizeof(buf)); 20 | return {ntohs(ipv4->sin_port), buf, "IPv4"}; 21 | } else { 22 | sockaddr_in6 *ipv6 = (sockaddr_in6 *) &addr; 23 | inet_ntop(AF_INET6, &ipv6->sin6_addr, buf, sizeof(buf)); 24 | return {ntohs(ipv6->sin6_port), buf, "IPv6"}; 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/addon.cpp: -------------------------------------------------------------------------------- 1 | #include "../src/uWS.h" 2 | #include "addon.h" 3 | #include "http.h" 4 | 5 | void Main(Local exports) { 6 | Isolate *isolate = exports->GetIsolate(); 7 | 8 | exports->Set(String::NewFromUtf8(isolate, "server"), Namespace(isolate).object); 9 | exports->Set(String::NewFromUtf8(isolate, "client"), Namespace(isolate).object); 10 | exports->Set(String::NewFromUtf8(isolate, "httpServer"), HttpServer::getHttpServer(isolate)); 11 | 12 | NODE_SET_METHOD(exports, "setUserData", setUserData); 13 | NODE_SET_METHOD(exports, "getUserData", getUserData); 14 | NODE_SET_METHOD(exports, "clearUserData", clearUserData); 15 | NODE_SET_METHOD(exports, "getAddress", getAddress); 16 | 17 | NODE_SET_METHOD(exports, "transfer", transfer); 18 | NODE_SET_METHOD(exports, "upgrade", upgrade); 19 | NODE_SET_METHOD(exports, "connect", connect); 20 | NODE_SET_METHOD(exports, "setNoop", setNoop); 21 | registerCheck(isolate); 22 | } 23 | 24 | NODE_MODULE(uws, Main) 25 | -------------------------------------------------------------------------------- /test/node_modules/uws/src/uWS.h: -------------------------------------------------------------------------------- 1 | #ifndef UWS_UWS_H 2 | #define UWS_UWS_H 3 | 4 | #include "Hub.h" 5 | 6 | #endif // UWS_UWS_H 7 | -------------------------------------------------------------------------------- /test/node_modules/uws/uws_darwin_46.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_darwin_46.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_darwin_47.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_darwin_47.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_darwin_48.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_darwin_48.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_darwin_51.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_darwin_51.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_linux_46.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_linux_46.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_linux_47.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_linux_47.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_linux_48.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_linux_48.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_linux_51.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_linux_51.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_win32_48.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_win32_48.node -------------------------------------------------------------------------------- /test/node_modules/uws/uws_win32_51.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/touskar/php-socket-io-event-emitter/5751abdc7719fc65528f92f859c94f296848d1f7/test/node_modules/uws/uws_win32_51.node -------------------------------------------------------------------------------- /test/node_modules/ws/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 Einar Otto Stangvik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/node_modules/ws/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ws: a node.js websocket client 3 | * Copyright(c) 2011 Einar Otto Stangvik 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const WebSocket = require('./lib/WebSocket'); 10 | 11 | WebSocket.Server = require('./lib/WebSocketServer'); 12 | WebSocket.Receiver = require('./lib/Receiver'); 13 | WebSocket.Sender = require('./lib/Sender'); 14 | 15 | module.exports = WebSocket; 16 | -------------------------------------------------------------------------------- /test/node_modules/ws/lib/BufferUtil.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ws: a node.js websocket client 3 | * Copyright(c) 2011 Einar Otto Stangvik 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict'; 8 | 9 | const safeBuffer = require('safe-buffer'); 10 | 11 | const Buffer = safeBuffer.Buffer; 12 | 13 | /** 14 | * Merges an array of buffers into a new buffer. 15 | * 16 | * @param {Buffer[]} list The array of buffers to concat 17 | * @param {Number} totalLength The total length of buffers in the list 18 | * @return {Buffer} The resulting buffer 19 | * @public 20 | */ 21 | const concat = (list, totalLength) => { 22 | const target = Buffer.allocUnsafe(totalLength); 23 | var offset = 0; 24 | 25 | for (var i = 0; i < list.length; i++) { 26 | const buf = list[i]; 27 | buf.copy(target, offset); 28 | offset += buf.length; 29 | } 30 | 31 | return target; 32 | }; 33 | 34 | try { 35 | const bufferUtil = require('bufferutil'); 36 | 37 | module.exports = Object.assign({ concat }, bufferUtil.BufferUtil || bufferUtil); 38 | } catch (e) /* istanbul ignore next */ { 39 | /** 40 | * Masks a buffer using the given mask. 41 | * 42 | * @param {Buffer} source The buffer to mask 43 | * @param {Buffer} mask The mask to use 44 | * @param {Buffer} output The buffer where to store the result 45 | * @param {Number} offset The offset at which to start writing 46 | * @param {Number} length The number of bytes to mask. 47 | * @public 48 | */ 49 | const mask = (source, mask, output, offset, length) => { 50 | for (var i = 0; i < length; i++) { 51 | output[offset + i] = source[i] ^ mask[i & 3]; 52 | } 53 | }; 54 | 55 | /** 56 | * Unmasks a buffer using the given mask. 57 | * 58 | * @param {Buffer} buffer The buffer to unmask 59 | * @param {Buffer} mask The mask to use 60 | * @public 61 | */ 62 | const unmask = (buffer, mask) => { 63 | // Required until https://github.com/nodejs/node/issues/9006 is resolved. 64 | const length = buffer.length; 65 | for (var i = 0; i < length; i++) { 66 | buffer[i] ^= mask[i & 3]; 67 | } 68 | }; 69 | 70 | module.exports = { concat, mask, unmask }; 71 | } 72 | -------------------------------------------------------------------------------- /test/node_modules/ws/lib/Constants.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const safeBuffer = require('safe-buffer'); 4 | 5 | const Buffer = safeBuffer.Buffer; 6 | 7 | exports.BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments']; 8 | exports.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; 9 | exports.EMPTY_BUFFER = Buffer.alloc(0); 10 | exports.NOOP = () => {}; 11 | -------------------------------------------------------------------------------- /test/node_modules/ws/lib/ErrorCodes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ws: a node.js websocket client 3 | * Copyright(c) 2011 Einar Otto Stangvik 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict'; 8 | 9 | module.exports = { 10 | isValidErrorCode: function (code) { 11 | return (code >= 1000 && code <= 1013 && code !== 1004 && code !== 1005 && code !== 1006) || 12 | (code >= 3000 && code <= 4999); 13 | }, 14 | 1000: 'normal', 15 | 1001: 'going away', 16 | 1002: 'protocol error', 17 | 1003: 'unsupported data', 18 | 1004: 'reserved', 19 | 1005: 'reserved for extensions', 20 | 1006: 'reserved for extensions', 21 | 1007: 'inconsistent or invalid data', 22 | 1008: 'policy violation', 23 | 1009: 'message too big', 24 | 1010: 'extension handshake missing', 25 | 1011: 'an unexpected condition prevented the request from being fulfilled', 26 | 1012: 'service restart', 27 | 1013: 'try again later' 28 | }; 29 | -------------------------------------------------------------------------------- /test/node_modules/ws/lib/Extensions.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Parse the `Sec-WebSocket-Extensions` header into an object. 5 | * 6 | * @param {String} value field value of the header 7 | * @return {Object} The parsed object 8 | * @public 9 | */ 10 | const parse = (value) => { 11 | value = value || ''; 12 | 13 | const extensions = {}; 14 | 15 | value.split(',').forEach((v) => { 16 | const params = v.split(';'); 17 | const token = params.shift().trim(); 18 | const paramsList = extensions[token] = extensions[token] || []; 19 | const parsedParams = {}; 20 | 21 | params.forEach((param) => { 22 | const parts = param.trim().split('='); 23 | const key = parts[0]; 24 | var value = parts[1]; 25 | 26 | if (value === undefined) { 27 | value = true; 28 | } else { 29 | // unquote value 30 | if (value[0] === '"') { 31 | value = value.slice(1); 32 | } 33 | if (value[value.length - 1] === '"') { 34 | value = value.slice(0, value.length - 1); 35 | } 36 | } 37 | (parsedParams[key] = parsedParams[key] || []).push(value); 38 | }); 39 | 40 | paramsList.push(parsedParams); 41 | }); 42 | 43 | return extensions; 44 | }; 45 | 46 | /** 47 | * Serialize a parsed `Sec-WebSocket-Extensions` header to a string. 48 | * 49 | * @param {Object} value The object to format 50 | * @return {String} A string representing the given value 51 | * @public 52 | */ 53 | const format = (value) => { 54 | return Object.keys(value).map((token) => { 55 | var paramsList = value[token]; 56 | if (!Array.isArray(paramsList)) paramsList = [paramsList]; 57 | return paramsList.map((params) => { 58 | return [token].concat(Object.keys(params).map((k) => { 59 | var p = params[k]; 60 | if (!Array.isArray(p)) p = [p]; 61 | return p.map((v) => v === true ? k : `${k}=${v}`).join('; '); 62 | })).join('; '); 63 | }).join(', '); 64 | }).join(', '); 65 | }; 66 | 67 | module.exports = { format, parse }; 68 | -------------------------------------------------------------------------------- /test/node_modules/ws/lib/Validation.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ws: a node.js websocket client 3 | * Copyright(c) 2011 Einar Otto Stangvik 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict'; 8 | 9 | try { 10 | const isValidUTF8 = require('utf-8-validate'); 11 | 12 | module.exports = typeof isValidUTF8 === 'object' 13 | ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0 14 | : isValidUTF8; 15 | } catch (e) /* istanbul ignore next */ { 16 | module.exports = () => true; 17 | } 18 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 passive.ly LLC 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/autotest.watchr: -------------------------------------------------------------------------------- 1 | def run_all_tests 2 | puts `clear` 3 | puts `node tests/test-constants.js` 4 | puts `node tests/test-headers.js` 5 | puts `node tests/test-request.js` 6 | end 7 | watch('.*.js') { run_all_tests } 8 | run_all_tests 9 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/example/demo.js: -------------------------------------------------------------------------------- 1 | var sys = require('util'); 2 | var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; 3 | 4 | var xhr = new XMLHttpRequest(); 5 | 6 | xhr.onreadystatechange = function() { 7 | sys.puts("State: " + this.readyState); 8 | 9 | if (this.readyState == 4) { 10 | sys.puts("Complete.\nBody length: " + this.responseText.length); 11 | sys.puts("Body:\n" + this.responseText); 12 | } 13 | }; 14 | 15 | xhr.open("GET", "http://driverdan.com"); 16 | xhr.send(); 17 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-constants.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr = new XMLHttpRequest(); 5 | 6 | // Test constant values 7 | assert.equal(0, xhr.UNSENT); 8 | assert.equal(1, xhr.OPENED); 9 | assert.equal(2, xhr.HEADERS_RECEIVED); 10 | assert.equal(3, xhr.LOADING); 11 | assert.equal(4, xhr.DONE); 12 | 13 | sys.puts("done"); 14 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-events.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , http = require("http") 4 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 5 | , xhr; 6 | 7 | // Test server 8 | var server = http.createServer(function (req, res) { 9 | var body = (req.method != "HEAD" ? "Hello World" : ""); 10 | 11 | res.writeHead(200, { 12 | "Content-Type": "text/plain", 13 | "Content-Length": Buffer.byteLength(body) 14 | }); 15 | // HEAD has no body 16 | if (req.method != "HEAD") { 17 | res.write(body); 18 | } 19 | res.end(); 20 | assert.equal(onreadystatechange, true); 21 | assert.equal(readystatechange, true); 22 | assert.equal(removed, true); 23 | sys.puts("done"); 24 | this.close(); 25 | }).listen(8000); 26 | 27 | xhr = new XMLHttpRequest(); 28 | 29 | // Track event calls 30 | var onreadystatechange = false; 31 | var readystatechange = false; 32 | var removed = true; 33 | var removedEvent = function() { 34 | removed = false; 35 | }; 36 | 37 | xhr.onreadystatechange = function() { 38 | onreadystatechange = true; 39 | }; 40 | 41 | xhr.addEventListener("readystatechange", function() { 42 | readystatechange = true; 43 | }); 44 | 45 | // This isn't perfect, won't guarantee it was added in the first place 46 | xhr.addEventListener("readystatechange", removedEvent); 47 | xhr.removeEventListener("readystatechange", removedEvent); 48 | 49 | xhr.open("GET", "http://localhost:8000"); 50 | xhr.send(); 51 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-exceptions.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr = new XMLHttpRequest(); 5 | 6 | // Test request methods that aren't allowed 7 | try { 8 | xhr.open("TRACK", "http://localhost:8000/"); 9 | console.log("ERROR: TRACK should have thrown exception"); 10 | } catch(e) {} 11 | try { 12 | xhr.open("TRACE", "http://localhost:8000/"); 13 | console.log("ERROR: TRACE should have thrown exception"); 14 | } catch(e) {} 15 | try { 16 | xhr.open("CONNECT", "http://localhost:8000/"); 17 | console.log("ERROR: CONNECT should have thrown exception"); 18 | } catch(e) {} 19 | // Test valid request method 20 | try { 21 | xhr.open("GET", "http://localhost:8000/"); 22 | } catch(e) { 23 | console.log("ERROR: Invalid exception for GET", e); 24 | } 25 | 26 | // Test forbidden headers 27 | var forbiddenRequestHeaders = [ 28 | "accept-charset", 29 | "accept-encoding", 30 | "access-control-request-headers", 31 | "access-control-request-method", 32 | "connection", 33 | "content-length", 34 | "content-transfer-encoding", 35 | "cookie", 36 | "cookie2", 37 | "date", 38 | "expect", 39 | "host", 40 | "keep-alive", 41 | "origin", 42 | "referer", 43 | "te", 44 | "trailer", 45 | "transfer-encoding", 46 | "upgrade", 47 | "via" 48 | ]; 49 | 50 | for (var i in forbiddenRequestHeaders) { 51 | if(xhr.setRequestHeader(forbiddenRequestHeaders[i], "Test") !== false) { 52 | console.log("ERROR: " + forbiddenRequestHeaders[i] + " should have thrown exception"); 53 | } 54 | } 55 | 56 | // Try valid header 57 | xhr.setRequestHeader("X-Foobar", "Test"); 58 | 59 | console.log("Done"); 60 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-redirect-302.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr = new XMLHttpRequest() 5 | , http = require("http"); 6 | 7 | // Test server 8 | var server = http.createServer(function (req, res) { 9 | if (req.url === '/redirectingResource') { 10 | res.writeHead(302, {'Location': 'http://localhost:8000/'}); 11 | res.end(); 12 | return; 13 | } 14 | 15 | var body = "Hello World"; 16 | res.writeHead(200, { 17 | "Content-Type": "text/plain", 18 | "Content-Length": Buffer.byteLength(body), 19 | "Date": "Thu, 30 Aug 2012 18:17:53 GMT", 20 | "Connection": "close" 21 | }); 22 | res.write("Hello World"); 23 | res.end(); 24 | 25 | this.close(); 26 | }).listen(8000); 27 | 28 | xhr.onreadystatechange = function() { 29 | if (this.readyState == 4) { 30 | assert.equal(xhr.getRequestHeader('Location'), ''); 31 | assert.equal(xhr.responseText, "Hello World"); 32 | sys.puts("done"); 33 | } 34 | }; 35 | 36 | try { 37 | xhr.open("GET", "http://localhost:8000/redirectingResource"); 38 | xhr.send(); 39 | } catch(e) { 40 | console.log("ERROR: Exception raised", e); 41 | } 42 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-redirect-303.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr = new XMLHttpRequest() 5 | , http = require("http"); 6 | 7 | // Test server 8 | var server = http.createServer(function (req, res) { 9 | if (req.url === '/redirectingResource') { 10 | res.writeHead(303, {'Location': 'http://localhost:8000/'}); 11 | res.end(); 12 | return; 13 | } 14 | 15 | var body = "Hello World"; 16 | res.writeHead(200, { 17 | "Content-Type": "text/plain", 18 | "Content-Length": Buffer.byteLength(body), 19 | "Date": "Thu, 30 Aug 2012 18:17:53 GMT", 20 | "Connection": "close" 21 | }); 22 | res.write("Hello World"); 23 | res.end(); 24 | 25 | this.close(); 26 | }).listen(8000); 27 | 28 | xhr.onreadystatechange = function() { 29 | if (this.readyState == 4) { 30 | assert.equal(xhr.getRequestHeader('Location'), ''); 31 | assert.equal(xhr.responseText, "Hello World"); 32 | sys.puts("done"); 33 | } 34 | }; 35 | 36 | try { 37 | xhr.open("POST", "http://localhost:8000/redirectingResource"); 38 | xhr.send(); 39 | } catch(e) { 40 | console.log("ERROR: Exception raised", e); 41 | } 42 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-redirect-307.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr = new XMLHttpRequest() 5 | , http = require("http"); 6 | 7 | // Test server 8 | var server = http.createServer(function (req, res) { 9 | if (req.url === '/redirectingResource') { 10 | res.writeHead(307, {'Location': 'http://localhost:8000/'}); 11 | res.end(); 12 | return; 13 | } 14 | 15 | assert.equal(req.method, 'POST'); 16 | 17 | var body = "Hello World"; 18 | res.writeHead(200, { 19 | "Content-Type": "text/plain", 20 | "Content-Length": Buffer.byteLength(body), 21 | "Date": "Thu, 30 Aug 2012 18:17:53 GMT", 22 | "Connection": "close" 23 | }); 24 | res.write("Hello World"); 25 | res.end(); 26 | 27 | this.close(); 28 | }).listen(8000); 29 | 30 | xhr.onreadystatechange = function() { 31 | if (this.readyState == 4) { 32 | assert.equal(xhr.getRequestHeader('Location'), ''); 33 | assert.equal(xhr.responseText, "Hello World"); 34 | sys.puts("done"); 35 | } 36 | }; 37 | 38 | try { 39 | xhr.open("POST", "http://localhost:8000/redirectingResource"); 40 | xhr.send(); 41 | } catch(e) { 42 | console.log("ERROR: Exception raised", e); 43 | } 44 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-request-methods.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , http = require("http") 5 | , xhr; 6 | 7 | // Test server 8 | var server = http.createServer(function (req, res) { 9 | // Check request method and URL 10 | assert.equal(methods[curMethod], req.method); 11 | assert.equal("/" + methods[curMethod], req.url); 12 | 13 | var body = (req.method != "HEAD" ? "Hello World" : ""); 14 | 15 | res.writeHead(200, { 16 | "Content-Type": "text/plain", 17 | "Content-Length": Buffer.byteLength(body) 18 | }); 19 | // HEAD has no body 20 | if (req.method != "HEAD") { 21 | res.write(body); 22 | } 23 | res.end(); 24 | 25 | if (curMethod == methods.length - 1) { 26 | this.close(); 27 | sys.puts("done"); 28 | } 29 | }).listen(8000); 30 | 31 | // Test standard methods 32 | var methods = ["GET", "POST", "HEAD", "PUT", "DELETE"]; 33 | var curMethod = 0; 34 | 35 | function start(method) { 36 | // Reset each time 37 | xhr = new XMLHttpRequest(); 38 | 39 | xhr.onreadystatechange = function() { 40 | if (this.readyState == 4) { 41 | if (method == "HEAD") { 42 | assert.equal("", this.responseText); 43 | } else { 44 | assert.equal("Hello World", this.responseText); 45 | } 46 | 47 | curMethod++; 48 | 49 | if (curMethod < methods.length) { 50 | sys.puts("Testing " + methods[curMethod]); 51 | start(methods[curMethod]); 52 | } 53 | } 54 | }; 55 | 56 | var url = "http://localhost:8000/" + method; 57 | xhr.open(method, url); 58 | xhr.send(); 59 | } 60 | 61 | sys.puts("Testing " + methods[curMethod]); 62 | start(methods[curMethod]); 63 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/test-request-protocols.js: -------------------------------------------------------------------------------- 1 | var sys = require("util") 2 | , assert = require("assert") 3 | , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest 4 | , xhr; 5 | 6 | xhr = new XMLHttpRequest(); 7 | 8 | xhr.onreadystatechange = function() { 9 | if (this.readyState == 4) { 10 | assert.equal("Hello World", this.responseText); 11 | runSync(); 12 | } 13 | }; 14 | 15 | // Async 16 | var url = "file://" + __dirname + "/testdata.txt"; 17 | xhr.open("GET", url); 18 | xhr.send(); 19 | 20 | // Sync 21 | var runSync = function() { 22 | xhr = new XMLHttpRequest(); 23 | 24 | xhr.onreadystatechange = function() { 25 | if (this.readyState == 4) { 26 | assert.equal("Hello World", this.responseText); 27 | sys.puts("done"); 28 | } 29 | }; 30 | xhr.open("GET", url, false); 31 | xhr.send(); 32 | } 33 | -------------------------------------------------------------------------------- /test/node_modules/xmlhttprequest-ssl/tests/testdata.txt: -------------------------------------------------------------------------------- 1 | Hello World -------------------------------------------------------------------------------- /test/node_modules/yeast/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /test/node_modules/yeast/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('') 4 | , length = 64 5 | , map = {} 6 | , seed = 0 7 | , i = 0 8 | , prev; 9 | 10 | /** 11 | * Return a string representing the specified number. 12 | * 13 | * @param {Number} num The number to convert. 14 | * @returns {String} The string representation of the number. 15 | * @api public 16 | */ 17 | function encode(num) { 18 | var encoded = ''; 19 | 20 | do { 21 | encoded = alphabet[num % length] + encoded; 22 | num = Math.floor(num / length); 23 | } while (num > 0); 24 | 25 | return encoded; 26 | } 27 | 28 | /** 29 | * Return the integer value specified by the given string. 30 | * 31 | * @param {String} str The string to convert. 32 | * @returns {Number} The integer value represented by the string. 33 | * @api public 34 | */ 35 | function decode(str) { 36 | var decoded = 0; 37 | 38 | for (i = 0; i < str.length; i++) { 39 | decoded = decoded * length + map[str.charAt(i)]; 40 | } 41 | 42 | return decoded; 43 | } 44 | 45 | /** 46 | * Yeast: A tiny growing id generator. 47 | * 48 | * @returns {String} A unique id. 49 | * @api public 50 | */ 51 | function yeast() { 52 | var now = encode(+new Date()); 53 | 54 | if (now !== prev) return seed = 0, prev = now; 55 | return now +'.'+ encode(seed++); 56 | } 57 | 58 | // 59 | // Map each character to its index. 60 | // 61 | for (; i < length; i++) map[alphabet[i]] = i; 62 | 63 | // 64 | // Expose the `yeast`, `encode` and `decode` functions. 65 | // 66 | yeast.encode = encode; 67 | yeast.decode = decode; 68 | module.exports = yeast; 69 | -------------------------------------------------------------------------------- /test/socket-server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by mac on 08/06/2017. 3 | */ 4 | 5 | var app = require('http').createServer(handler) 6 | var io = require('socket.io')(app); 7 | var fs = require('fs'); 8 | 9 | app.listen(9001); 10 | 11 | function handler (req, res) { 12 | res.writeHead(200); 13 | res.end('Hello Word'); 14 | } 15 | 16 | 17 | io.on('connection', function (socket) { 18 | 19 | console.log("New Connection with transport", socket.conn.transport.name); 20 | 21 | console.log('With handshake', socket.handshake); 22 | 23 | 24 | console.log('With query', socket.handshake.query); 25 | 26 | socket.on('eventFromPhp', function (data) { 27 | console.log('Data from Php', data, JSON.parse(data)); 28 | }); 29 | }); --------------------------------------------------------------------------------