nodejs with express server, leapmotion for movement control, and threejs for 3d render

This commit is contained in:
idoctnef
2016-05-30 18:14:08 +02:00
parent e2aeac1bae
commit 52b63ee33a
893 changed files with 127726 additions and 0 deletions

3
node_modules/socket.io-client/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
test
support
.gitignore

45
node_modules/socket.io-client/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,45 @@
language: node_js
node_js:
- '0.10'
notifications:
irc: irc.freenode.org#socket.io
env:
global:
- secure: wn0UtEtmR0+5ecvr8mXaLJey5XZ4a3j2f5EDoBW0ItALKixqRR6wCrdplwp9MMEDGuer11byIy2YJ+HRazgpcdf+3IuHmSvLb5IItbAaEwcjskawarGcYQO8Gy6GffkbYLFsjEhlkFk9+yXPJuws9msY2+9Y0IymgY8rT9O4D98=
- secure: f5EAsqnJNW//oUgShxSGcDQsz6NUbwfkZCKoPymTamjyK69N5/Q70MQ5UrF3gih3ZiwWDK7Cd6T394vU+Jdrf+LdOdzgef3sz8YJbF3HiOOLp5tYuFVOtOMCBkefdJ/JkqFvrBQUgo3klSD6jUz2SdRlwi33iYlYO8mleO8IxRo=
- secure: 0ah52GLAyJYZwJpnYbTscXgSuSoRLQBj/X0mZeeNGofPbQdWyhQoyBJMq77cTZJQ0mPKd3acojRH5DzYO5q0sMMPkN5mW3couqlyMk94PoYgaiTYRj7dzPnegi1myeVTioX9jomwkh1j+kg1diIHz+VHOgp9n7u595F0HnVXRwA=
- secure: MFEtLhbKZKQDsU9h6dXLRSSZfBUWRJgVV4pucS0bSVA4SZ3Cqq405mg83EiUCww0L0jMXkKKojxcbNl5aHHIzWtTDJTiDw1ifQrIWsbSZ4IPFixd98hU9N7fI4BkEiNhN2j5W4iF+52GDr6Msuy9+6bbuUXEWcJnhjrJ4ePNlBs=
matrix:
include:
- node_js: '0.10'
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
#- node_js: '0.10'
#env: BROWSER_NAME=firefox BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=safari BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=6
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=7
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=8
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=9
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=10 BROWSER_PLATFORM="Windows 2012"
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=latest BROWSER_PLATFORM="Windows 2012"
- node_js: '0.10'
env: BROWSER_NAME=iphone BROWSER_VERSION=6.1
- node_js: '0.10'
env: BROWSER_NAME=iphone BROWSER_VERSION=7.1
- node_js: '0.10'
env: BROWSER_NAME=android BROWSER_VERSION=4.0
- node_js: '0.10'
env: BROWSER_NAME=android BROWSER_VERSION=4.1
- node_js: '0.10'
env: BROWSER_NAME=android BROWSER_VERSION=4.2
- node_js: '0.10'
env: BROWSER_NAME=android BROWSER_VERSION=4.3
- node_js: '0.10'
env: BROWSER_NAME=android BROWSER_VERSION=4.4

19
node_modules/socket.io-client/.zuul.yml generated vendored Normal file
View File

@@ -0,0 +1,19 @@
ui: mocha-bdd
server: ./test/support/server.js
browsers:
- name: chrome
version: 29..latest
- name: firefox
version: latest
- name: safari
version: latest
- name: ie
version: 10
platform: Windows 2012
- name: ie
version: [6..9, latest]
- name: iphone
version: 6.0..latest
- name: android
version: oldest..latest
version: 5.1

342
node_modules/socket.io-client/History.md generated vendored Normal file
View File

@@ -0,0 +1,342 @@
1.2.0 / 2014-10-27
==================
* bump `engine.io-client`.
* set `readyState` before engine.io close event
* fix reconnection after reconnecting manually
* enable to stop reconnecting
* downloads badge
* support no schema relative url
* enable to reconnect manually
1.1.0 / 2014-09-04
==================
* socket: fix in `has-binary`
* package: bump `socket.io-parser`
* package: bump `engine.io-client`
* further increase test timeout.
* double to singly quotes in tests.
* extend timeout and remember to close everything in each test case
* fix travis
* add travis + zuul matrix
* use svg instead of png to get better image quality in readme
* make CI build faster
* removed unnecessary code from try block. Only decode packet is needed.
* package: bump `browserify`
* package: bump `engine.io-client`
* fix autoConnect option
* npmignore: ignore `.gitignore`
* package: update `browserify`
* don't fire an extra reconnect when we're not reconnecting
after a failed initial connect attempt
* package: bump `socket.io-parser` for `component-emitter` dep fix
* updated tests to reflect `autoConnect` option
* add `autoConnect` option to wait with connecting
1.0.6 / 2014-06-19
==================
* test fixes on internet explorer
* fixes for duplicate event propagation from manager instance [Rase-]
1.0.5 / 2014-06-16
==================
* package: bump `engine.io-client` for better deps and smaller build
* handle io.connect(null, opts) correctly [audreyt]
* url: fix incorrect ports in certain connections [holic]
* manager: propagate all reconnection events to sockets [Rase-]
* index: added BC for `force new connection`
* socket: fix event buffering while in disconnected state [kevin-roark]
* package: stop using tarballs in dependencies [reid]
* manager: relay `connect_error` and `connect_timeout` to sockets
1.0.4 / 2014-06-02
==================
* update build
1.0.3 / 2014-05-31
==================
* package; bump `socket.io-parser` for binary ACK fix
* package: bump `engine.io-client` for binary UTF8 fix
1.0.2 / 2014-05-28
==================
* package: bump `socket.io-parser` for windows fix
1.0.1 / 2014-05-28
==================
* override npm tag
1.0.0 / 2014-05-28
==================
* stable release
1.0.0-pre5 / 2014-05-22
=======================
* package: bump `engine.io-client` for parser fixes
1.0.0-pre4 / 2014-05-19
=======================
* build
1.0.0-pre3 / 2014-05-17
=======================
* package: bump parser
* package: bump engine.io-client
1.0.0-pre2 / 2014-04-27
=======================
* package: bump `engine.io-client`
* package: bump `zuul`
* allows user-level query string parameters to be in socket.request
* package: bump `socket.io-parser`
* package: bump `engine.io-client` for android fix
* tidy up .gitignore
1.0.0-pre / 2014-03-14
======================
* implemented `engine.io-client`
* implemented `socket.io-parser`
* implemented `json3` to avoid env pollution
* implemented `debug`
* added binary support
* added `browserify` support
0.9.11 / 2012-11-02
===================
* Enable use of 'xhr' transport in Node.js
* Fix the problem with disconnecting xhr-polling users
* Add should to devDependencies
* Prefer XmlHttpRequest if CORS is available
* Make client compatible with AMD loaders.
0.9.10 / 2012-08-10
===================
* fix removeAllListeners to behave as expected.
* set withCredentials to true only if xdomain.
* socket: disable disconnect on unload by default.
0.9.9 / 2012-08-01
==================
* socket: fixed disconnect xhr url and made it actually sync
* *: bump xmlhttprequest dep
0.9.8 / 2012-07-24
==================
* Fixed build.
0.9.7 / 2012-07-24
==================
* iOS websocket crash fix.
* Fixed potential `open` collision.
* Fixed disconnectSync.
0.9.6 / 2012-04-17
==================
* Don't position the jsonp form off the screen (android fix).
0.9.5 / 2012-04-05
==================
* Bumped version.
0.9.4 / 2012-04-01
==================
* Fixes polling loop upon reconnect advice (fixes #438).
0.9.3 / 2012-03-28
==================
* Fix XHR.check, which was throwing an error transparently and causing non-IE browsers to fall back to JSONP [mikito]
* Fixed forced disconnect on window close [zzzaaa]
0.9.2 / 2012-03-13
==================
* Transport order set by "options" [zzzaaa]
0.9.1-1 / 2012-03-02
====================
* Fixed active-x-obfuscator NPM dependency.
0.9.1 / 2012-03-02
==================
* Misc corrections.
* Added warning within Firefox about webworker test in test runner.
* Update ws dependency [einaros]
* Implemented client side heartbeat checks. [felixge]
* Improved Firewall support with ActiveX obfuscation. [felixge]
* Fixed error handling during connection process. [Outsideris]
0.9.0 / 2012-02-26
==================
* Added DS_Store to gitignore.
* Updated depedencies.
* Bumped uglify
* Tweaking code so it doesn't throw an exception when used inside a WebWorker in Firefox
* Do not rely on Array.prototype.indexOf as it breaks with pages that use the Prototype.js library.
* Windows support landed
* Use @einaros ws module instead of the old crap one
* Fix for broken closeTimeout and 'IE + xhr' goes into infinite loop on disconnection
* Disabled reconnection on error if reconnect option is set to false
* Set withCredentials to true before xhr to fix authentication
* Clears the timeout from reconnection attempt when there is a successful or failed reconnection.
This fixes the issue of setTimeout's carrying over from previous reconnection
and changing (skipping) values of self.reconnectionDelay in the newer reconnection.
* Removed decoding of parameters when chunking the query string.
This was used later on to construct the url to post to the socket.io server
for connection and if we're adding custom parameters of our own to this url
(for example for OAuth authentication) they were being sent decoded, which is wrong.
0.8.7 / 2011-11-05
==================
* Bumped client
0.8.6 / 2011-10-27
==================
* Added WebWorker support.
* Fixed swfobject and web_socket.js to not assume window.
* Fixed CORS detection for webworker.
* Fix `defer` for webkit in a webworker.
* Fixed io.util.request to not rely on window.
* FIxed; use global instead of window and dont rely on document.
* Fixed; JSON-P handshake if CORS is not available.
* Made underlying Transport disconnection trigger immediate socket.io disconnect.
* Fixed warning when compressing with Google Closure Compiler.
* Fixed builder's uglify utf-8 support.
* Added workaround for loading indicator in FF jsonp-polling. [3rd-Eden]
* Fixed host discovery lookup. [holic]
* Fixed close timeout when disconnected/reconnecting. [jscharlach]
* Fixed jsonp-polling feature detection.
* Fixed jsonp-polling client POSTing of \n.
* Fixed test runner on IE6/7
0.8.5 / 2011-10-07
==================
* Bumped client
0.8.4 / 2011-09-06
==================
* Corrected build
0.8.3 / 2011-09-03
==================
* Fixed `\n` parsing for non-JSON packets.
* Fixed; make Socket.IO XHTML doctype compatible (fixes #460 from server)
* Fixed support for Node.JS running `socket.io-client`.
* Updated repository name in `package.json`.
* Added support for different policy file ports without having to port
forward 843 on the server side [3rd-Eden]
0.8.2 / 2011-08-29
==================
* Fixed flashsocket detection.
0.8.1 / 2011-08-29
==================
* Bump version.
0.8.0 / 2011-08-28
==================
* Added MozWebSocket support (hybi-10 doesn't require API changes) [einaros].
0.7.11 / 2011-08-27
===================
* Corrected previous release (missing build).
0.7.10 / 2011-08-27
===================
* Fix for failing fallback in websockets
0.7.9 / 2011-08-12
==================
* Added check on `Socket#onConnect` to prevent double `connect` events on the main manager.
* Fixed socket namespace connect test. Remove broken alternative namespace connect test.
* Removed test handler for removed test.
* Bumped version to match `socket.io` server.
0.7.5 / 2011-08-08
==================
* Added querystring support for `connect` [3rd-Eden]
* Added partial Node.JS transports support [3rd-Eden, josephg]
* Fixed builder test.
* Changed `util.inherit` to replicate Object.create / __proto__.
* Changed and cleaned up some acceptance tests.
* Fixed race condition with a test that could not be run multiple times.
* Added test for encoding a payload.
* Added the ability to override the transport to use in acceptance test [3rd-Eden]
* Fixed multiple connect packets [DanielBaulig]
* Fixed jsonp-polling over-buffering [3rd-Eden]
* Fixed ascii preservation in minified socket.io client [3rd-Eden]
* Fixed socket.io in situations where the page is not served through utf8.
* Fixed namespaces not reconnecting after disconnect [3rd-Eden]
* Fixed default port for secure connections.
0.7.4 / 2011-07-12
==================
* Added `SocketNamespace#of` shortcut. [3rd-Eden]
* Fixed a IE payload decoding bug. [3rd-Eden]
* Honor document protocol, unless overriden. [dvv]
* Fixed new builder dependencies. [3rd-Eden]
0.7.3 / 2011-06-30
==================
* Fixed; acks don't depend on arity. They're automatic for `.send` and
callback based for `.emit`. [dvv]
* Added support for sub-sockets authorization. [3rd-Eden]
* Added BC support for `new io.connect`. [fat]
* Fixed double `connect` events. [3rd-Eden]
* Fixed reconnection with jsonp-polling maintaining old sessionid. [franck34]
0.7.2 / 2011-06-22
==================
* Added `noop` message type.
0.7.1 / 2011-06-21
==================
* Bumped socket.io dependency version for acceptance tests.
0.7.0 / 2011-06-21
==================
* http://socket.io/announcement.html

36
node_modules/socket.io-client/Makefile generated vendored Normal file
View File

@@ -0,0 +1,36 @@
REPORTER = dot
build: socket.io.js
socket.io.js: lib/*.js package.json
@./support/browserify.sh > socket.io.js
test:
@if [ "x$(BROWSER_NAME)" = "x" ]; then make test-node; else make test-zuul; fi
test-node:
@./node_modules/.bin/mocha \
--reporter $(REPORTER) \
test/index.js
test-zuul:
@if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
./node_modules/zuul/bin/zuul \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
test/index.js; \
else \
./node_modules/zuul/bin/zuul \
--browser-name $(BROWSER_NAME) \
--browser-version $(BROWSER_VERSION) \
--browser-platform "$(BROWSER_PLATFORM)" \
test/index.js; \
fi
test-cov:
@./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
--reporter $(REPORTER) \
test/
.PHONY: test

166
node_modules/socket.io-client/README.md generated vendored Normal file
View File

@@ -0,0 +1,166 @@
# socket.io-client
[![Build Status](https://secure.travis-ci.org/Automattic/socket.io-client.svg)](http://travis-ci.org/Automattic/socket.io-client)
[![NPM version](https://badge.fury.io/js/socket.io-client.svg)](http://badge.fury.io/js/socket.io-client)
![Downloads](http://img.shields.io/npm/dm/socket.io-client.svg)
## How to use
A standalone build of `socket.io-client` is exposed automatically by the
socket.io server as `/socket.io/socket.io.js`. Alternatively you can
serve the file `socket.io.js` found at the root of this repository.
```html
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', function(){});
});
</script>
```
Socket.IO is compatible with [browserify](http://browserify.org/).
### Node.JS (server-side usage)
Add `socket.io-client` to your `package.json` and then:
```js
var socket = require('socket.io-client')('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', function(){});
});
```
## API
### IO(url:String, opts:Object):Socket
Exposed as the `io` namespace in the standalone build, or the result
of calling `require('socket.io-client')`.
When called, it creates a new `Manager` for the given URL, and attempts
to reuse an existing `Manager` for subsequent calls, unless the
`multiplex` option is passed with `false`.
The rest of the options are passed to the `Manager` constructor (see below
for details).
A `Socket` instance is returned for the namespace specified by the
pathname in the URL, defaulting to `/`. For example, if the `url` is
`http://localhost/users`, a transport connection will be established to
`http://localhost` and a Socket.IO connection will be established to
`/users`.
### IO#protocol
Socket.io protocol revision number this client works with.
### IO#Socket
Reference to the `Socket` constructor.
### IO#Manager
Reference to the `Manager` constructor.
### IO#Emitter
Reference to the `Emitter` constructor.
### Manager(url:String, opts:Object)
A `Manager` represents a connection to a given Socket.IO server. One or
more `Socket` instances are associated with the manager. The manager
can be accessed through the `io` property of each `Socket` instance.
The `opts` are also passed to `engine.io` upon initialization of the
underlying `Socket`.
Options:
- `reconnection` whether to reconnect automatically (`true`)
- `reconnectionDelay` how long to wait before attempting a new
reconnection (`1000`)
- `reconnectionDelayMax` maximum amount of time to wait between
reconnections (`5000`). Each attempt increases the reconnection by
the amount specified by `reconnectionDelay`.
- `timeout` connection timeout before a `connect_error`
and `connect_timeout` events are emitted (`20000`)
- `autoConnect` by setting this false, you have to call `manager.open`
whenever you decide it's appropriate
#### Events
- `connect`. Fired upon a successful connection.
- `connect_error`. Fired upon a connection error.
Parameters:
- `Object` error object
- `connect_timeout`. Fired upon a connection timeout.
- `reconnect`. Fired upon a successful reconnection.
Parameters:
- `Number` reconnection attempt number
- `reconnect_attempt`. Fired upon an attempt to reconnect.
- `reconnecting`. Fired upon an attempt to reconnect.
Parameters:
- `Number` reconnection attempt number
- `reconnect_error`. Fired upon a reconnection attempt error.
Parameters:
- `Object` error object
- `reconnect_failed`. Fired when couldn't reconnect within `reconnectionAttempts`
The events above are also emitted on the individual sockets that
reconnect that depend on this `Manager`.
### Manager#reconnection(v:Boolean):Manager
Sets the `reconnection` option, or returns it if no parameters
are passed.
### Manager#reconnectionAttempts(v:Boolean):Manager
Sets the `reconnectionAttempts` option, or returns it if no parameters
are passed.
### Manager#reconnectionDelay(v:Boolean):Manager
Sets the `reconectionDelay` option, or returns it if no parameters
are passed.
### Manager#reconnectionDelayMax(v:Boolean):Manager
Sets the `reconectionDelayMax` option, or returns it if no parameters
are passed.
### Manager#timeout(v:Boolean):Manager
Sets the `timeout` option, or returns it if no parameters
are passed.
### Socket
#### Events
- `connect`. Fired upon connecting.
- `error`. Fired upon a connection error
Parameters:
- `Object` error data
- `disconnect`. Fired upon a disconnection.
- `reconnect`. Fired upon a successful reconnection.
Parameters:
- `Number` reconnection attempt number
- `reconnect_attempt`. Fired upon an attempt to reconnect.
- `reconnecting`. Fired upon an attempt to reconnect.
Parameters:
- `Number` reconnection attempt number
- `reconnect_error`. Fired upon a reconnection attempt error.
Parameters:
- `Object` error object
- `reconnect_failed`. Fired when couldn't reconnect within `reconnectionAttempts`
## License
MIT

2
node_modules/socket.io-client/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
module.exports = require('./lib/');

87
node_modules/socket.io-client/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,87 @@
/**
* Module dependencies.
*/
var url = require('./url');
var parser = require('socket.io-parser');
var Manager = require('./manager');
var debug = require('debug')('socket.io-client');
/**
* Module exports.
*/
module.exports = exports = lookup;
/**
* Managers cache.
*/
var cache = exports.managers = {};
/**
* Looks up an existing `Manager` for multiplexing.
* If the user summons:
*
* `io('http://localhost/a');`
* `io('http://localhost/b');`
*
* We reuse the existing instance based on same scheme/port/host,
* and we initialize sockets for each namespace.
*
* @api public
*/
function lookup(uri, opts) {
if (typeof uri == 'object') {
opts = uri;
uri = undefined;
}
opts = opts || {};
var parsed = url(uri);
var source = parsed.source;
var id = parsed.id;
var io;
if (opts.forceNew || opts['force new connection'] || false === opts.multiplex) {
debug('ignoring socket cache for %s', source);
io = Manager(source, opts);
} else {
if (!cache[id]) {
debug('new io instance for %s', source);
cache[id] = Manager(source, opts);
}
io = cache[id];
}
return io.socket(parsed.path);
}
/**
* Protocol version.
*
* @api public
*/
exports.protocol = parser.protocol;
/**
* `connect`.
*
* @param {String} uri
* @api public
*/
exports.connect = lookup;
/**
* Expose constructors for standalone build.
*
* @api public
*/
exports.Manager = require('./manager');
exports.Socket = require('./socket');

473
node_modules/socket.io-client/lib/manager.js generated vendored Normal file
View File

@@ -0,0 +1,473 @@
/**
* Module dependencies.
*/
var url = require('./url');
var eio = require('engine.io-client');
var Socket = require('./socket');
var Emitter = require('component-emitter');
var parser = require('socket.io-parser');
var on = require('./on');
var bind = require('component-bind');
var object = require('object-component');
var debug = require('debug')('socket.io-client:manager');
var indexOf = require('indexof');
/**
* Module exports
*/
module.exports = Manager;
/**
* `Manager` constructor.
*
* @param {String} engine instance or engine uri/opts
* @param {Object} options
* @api public
*/
function Manager(uri, opts){
if (!(this instanceof Manager)) return new Manager(uri, opts);
if (uri && ('object' == typeof uri)) {
opts = uri;
uri = undefined;
}
opts = opts || {};
opts.path = opts.path || '/socket.io';
this.nsps = {};
this.subs = [];
this.opts = opts;
this.reconnection(opts.reconnection !== false);
this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
this.reconnectionDelay(opts.reconnectionDelay || 1000);
this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
this.timeout(null == opts.timeout ? 20000 : opts.timeout);
this.readyState = 'closed';
this.uri = uri;
this.connected = [];
this.attempts = 0;
this.encoding = false;
this.packetBuffer = [];
this.encoder = new parser.Encoder();
this.decoder = new parser.Decoder();
this.autoConnect = opts.autoConnect !== false;
if (this.autoConnect) this.open();
}
/**
* Propagate given event to sockets and emit on `this`
*
* @api private
*/
Manager.prototype.emitAll = function() {
this.emit.apply(this, arguments);
for (var nsp in this.nsps) {
this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
}
};
/**
* Mix in `Emitter`.
*/
Emitter(Manager.prototype);
/**
* Sets the `reconnection` config.
*
* @param {Boolean} true/false if it should automatically reconnect
* @return {Manager} self or value
* @api public
*/
Manager.prototype.reconnection = function(v){
if (!arguments.length) return this._reconnection;
this._reconnection = !!v;
return this;
};
/**
* Sets the reconnection attempts config.
*
* @param {Number} max reconnection attempts before giving up
* @return {Manager} self or value
* @api public
*/
Manager.prototype.reconnectionAttempts = function(v){
if (!arguments.length) return this._reconnectionAttempts;
this._reconnectionAttempts = v;
return this;
};
/**
* Sets the delay between reconnections.
*
* @param {Number} delay
* @return {Manager} self or value
* @api public
*/
Manager.prototype.reconnectionDelay = function(v){
if (!arguments.length) return this._reconnectionDelay;
this._reconnectionDelay = v;
return this;
};
/**
* Sets the maximum delay between reconnections.
*
* @param {Number} delay
* @return {Manager} self or value
* @api public
*/
Manager.prototype.reconnectionDelayMax = function(v){
if (!arguments.length) return this._reconnectionDelayMax;
this._reconnectionDelayMax = v;
return this;
};
/**
* Sets the connection timeout. `false` to disable
*
* @return {Manager} self or value
* @api public
*/
Manager.prototype.timeout = function(v){
if (!arguments.length) return this._timeout;
this._timeout = v;
return this;
};
/**
* Starts trying to reconnect if reconnection is enabled and we have not
* started reconnecting yet
*
* @api private
*/
Manager.prototype.maybeReconnectOnOpen = function() {
// Only try to reconnect if it's the first time we're connecting
if (!this.openReconnect && !this.reconnecting && this._reconnection && this.attempts === 0) {
// keeps reconnection from firing twice for the same reconnection loop
this.openReconnect = true;
this.reconnect();
}
};
/**
* Sets the current transport `socket`.
*
* @param {Function} optional, callback
* @return {Manager} self
* @api public
*/
Manager.prototype.open =
Manager.prototype.connect = function(fn){
debug('readyState %s', this.readyState);
if (~this.readyState.indexOf('open')) return this;
debug('opening %s', this.uri);
this.engine = eio(this.uri, this.opts);
var socket = this.engine;
var self = this;
this.readyState = 'opening';
this.skipReconnect = false;
// emit `open`
var openSub = on(socket, 'open', function() {
self.onopen();
fn && fn();
});
// emit `connect_error`
var errorSub = on(socket, 'error', function(data){
debug('connect_error');
self.cleanup();
self.readyState = 'closed';
self.emitAll('connect_error', data);
if (fn) {
var err = new Error('Connection error');
err.data = data;
fn(err);
}
self.maybeReconnectOnOpen();
});
// emit `connect_timeout`
if (false !== this._timeout) {
var timeout = this._timeout;
debug('connect attempt will timeout after %d', timeout);
// set timer
var timer = setTimeout(function(){
debug('connect attempt timed out after %d', timeout);
openSub.destroy();
socket.close();
socket.emit('error', 'timeout');
self.emitAll('connect_timeout', timeout);
}, timeout);
this.subs.push({
destroy: function(){
clearTimeout(timer);
}
});
}
this.subs.push(openSub);
this.subs.push(errorSub);
return this;
};
/**
* Called upon transport open.
*
* @api private
*/
Manager.prototype.onopen = function(){
debug('open');
// clear old subs
this.cleanup();
// mark as open
this.readyState = 'open';
this.emit('open');
// add new subs
var socket = this.engine;
this.subs.push(on(socket, 'data', bind(this, 'ondata')));
this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
this.subs.push(on(socket, 'error', bind(this, 'onerror')));
this.subs.push(on(socket, 'close', bind(this, 'onclose')));
};
/**
* Called with data.
*
* @api private
*/
Manager.prototype.ondata = function(data){
this.decoder.add(data);
};
/**
* Called when parser fully decodes a packet.
*
* @api private
*/
Manager.prototype.ondecoded = function(packet) {
this.emit('packet', packet);
};
/**
* Called upon socket error.
*
* @api private
*/
Manager.prototype.onerror = function(err){
debug('error', err);
this.emitAll('error', err);
};
/**
* Creates a new socket for the given `nsp`.
*
* @return {Socket}
* @api public
*/
Manager.prototype.socket = function(nsp){
var socket = this.nsps[nsp];
if (!socket) {
socket = new Socket(this, nsp);
this.nsps[nsp] = socket;
var self = this;
socket.on('connect', function(){
if (!~indexOf(self.connected, socket)) {
self.connected.push(socket);
}
});
}
return socket;
};
/**
* Called upon a socket close.
*
* @param {Socket} socket
*/
Manager.prototype.destroy = function(socket){
var index = indexOf(this.connected, socket);
if (~index) this.connected.splice(index, 1);
if (this.connected.length) return;
this.close();
};
/**
* Writes a packet.
*
* @param {Object} packet
* @api private
*/
Manager.prototype.packet = function(packet){
debug('writing packet %j', packet);
var self = this;
if (!self.encoding) {
// encode, then write to engine with result
self.encoding = true;
this.encoder.encode(packet, function(encodedPackets) {
for (var i = 0; i < encodedPackets.length; i++) {
self.engine.write(encodedPackets[i]);
}
self.encoding = false;
self.processPacketQueue();
});
} else { // add packet to the queue
self.packetBuffer.push(packet);
}
};
/**
* If packet buffer is non-empty, begins encoding the
* next packet in line.
*
* @api private
*/
Manager.prototype.processPacketQueue = function() {
if (this.packetBuffer.length > 0 && !this.encoding) {
var pack = this.packetBuffer.shift();
this.packet(pack);
}
};
/**
* Clean up transport subscriptions and packet buffer.
*
* @api private
*/
Manager.prototype.cleanup = function(){
var sub;
while (sub = this.subs.shift()) sub.destroy();
this.packetBuffer = [];
this.encoding = false;
this.decoder.destroy();
};
/**
* Close the current socket.
*
* @api private
*/
Manager.prototype.close =
Manager.prototype.disconnect = function(){
this.skipReconnect = true;
this.readyState = 'closed';
this.engine && this.engine.close();
};
/**
* Called upon engine close.
*
* @api private
*/
Manager.prototype.onclose = function(reason){
debug('close');
this.cleanup();
this.readyState = 'closed';
this.emit('close', reason);
if (this._reconnection && !this.skipReconnect) {
this.reconnect();
}
};
/**
* Attempt a reconnection.
*
* @api private
*/
Manager.prototype.reconnect = function(){
if (this.reconnecting || this.skipReconnect) return this;
var self = this;
this.attempts++;
if (this.attempts > this._reconnectionAttempts) {
debug('reconnect failed');
this.emitAll('reconnect_failed');
this.reconnecting = false;
} else {
var delay = this.attempts * this.reconnectionDelay();
delay = Math.min(delay, this.reconnectionDelayMax());
debug('will wait %dms before reconnect attempt', delay);
this.reconnecting = true;
var timer = setTimeout(function(){
if (self.skipReconnect) return;
debug('attempting reconnect');
self.emitAll('reconnect_attempt', self.attempts);
self.emitAll('reconnecting', self.attempts);
// check again for the case socket closed in above events
if (self.skipReconnect) return;
self.open(function(err){
if (err) {
debug('reconnect attempt error');
self.reconnecting = false;
self.reconnect();
self.emitAll('reconnect_error', err.data);
} else {
debug('reconnect success');
self.onreconnect();
}
});
}, delay);
this.subs.push({
destroy: function(){
clearTimeout(timer);
}
});
}
};
/**
* Called upon successful reconnect.
*
* @api private
*/
Manager.prototype.onreconnect = function(){
var attempt = this.attempts;
this.attempts = 0;
this.reconnecting = false;
this.emitAll('reconnect', attempt);
};

24
node_modules/socket.io-client/lib/on.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* Module exports.
*/
module.exports = on;
/**
* Helper for subscriptions.
*
* @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
* @param {String} event name
* @param {Function} callback
* @api public
*/
function on(obj, ev, fn) {
obj.on(ev, fn);
return {
destroy: function(){
obj.removeListener(ev, fn);
}
};
}

384
node_modules/socket.io-client/lib/socket.js generated vendored Normal file
View File

@@ -0,0 +1,384 @@
/**
* Module dependencies.
*/
var parser = require('socket.io-parser');
var Emitter = require('component-emitter');
var toArray = require('to-array');
var on = require('./on');
var bind = require('component-bind');
var debug = require('debug')('socket.io-client:socket');
var hasBin = require('has-binary');
/**
* Module exports.
*/
module.exports = exports = Socket;
/**
* Internal events (blacklisted).
* These events can't be emitted by the user.
*
* @api private
*/
var events = {
connect: 1,
connect_error: 1,
connect_timeout: 1,
disconnect: 1,
error: 1,
reconnect: 1,
reconnect_attempt: 1,
reconnect_failed: 1,
reconnect_error: 1,
reconnecting: 1
};
/**
* Shortcut to `Emitter#emit`.
*/
var emit = Emitter.prototype.emit;
/**
* `Socket` constructor.
*
* @api public
*/
function Socket(io, nsp){
this.io = io;
this.nsp = nsp;
this.json = this; // compat
this.ids = 0;
this.acks = {};
if (this.io.autoConnect) this.open();
this.receiveBuffer = [];
this.sendBuffer = [];
this.connected = false;
this.disconnected = true;
}
/**
* Mix in `Emitter`.
*/
Emitter(Socket.prototype);
/**
* Subscribe to open, close and packet events
*
* @api private
*/
Socket.prototype.subEvents = function() {
if (this.subs) return;
var io = this.io;
this.subs = [
on(io, 'open', bind(this, 'onopen')),
on(io, 'packet', bind(this, 'onpacket')),
on(io, 'close', bind(this, 'onclose'))
];
};
/**
* "Opens" the socket.
*
* @api public
*/
Socket.prototype.open =
Socket.prototype.connect = function(){
if (this.connected) return this;
this.subEvents();
this.io.open(); // ensure open
if ('open' == this.io.readyState) this.onopen();
return this;
};
/**
* Sends a `message` event.
*
* @return {Socket} self
* @api public
*/
Socket.prototype.send = function(){
var args = toArray(arguments);
args.unshift('message');
this.emit.apply(this, args);
return this;
};
/**
* Override `emit`.
* If the event is in `events`, it's emitted normally.
*
* @param {String} event name
* @return {Socket} self
* @api public
*/
Socket.prototype.emit = function(ev){
if (events.hasOwnProperty(ev)) {
emit.apply(this, arguments);
return this;
}
var args = toArray(arguments);
var parserType = parser.EVENT; // default
if (hasBin(args)) { parserType = parser.BINARY_EVENT; } // binary
var packet = { type: parserType, data: args };
// event ack callback
if ('function' == typeof args[args.length - 1]) {
debug('emitting packet with ack id %d', this.ids);
this.acks[this.ids] = args.pop();
packet.id = this.ids++;
}
if (this.connected) {
this.packet(packet);
} else {
this.sendBuffer.push(packet);
}
return this;
};
/**
* Sends a packet.
*
* @param {Object} packet
* @api private
*/
Socket.prototype.packet = function(packet){
packet.nsp = this.nsp;
this.io.packet(packet);
};
/**
* Called upon engine `open`.
*
* @api private
*/
Socket.prototype.onopen = function(){
debug('transport is open - connecting');
// write connect packet if necessary
if ('/' != this.nsp) {
this.packet({ type: parser.CONNECT });
}
};
/**
* Called upon engine `close`.
*
* @param {String} reason
* @api private
*/
Socket.prototype.onclose = function(reason){
debug('close (%s)', reason);
this.connected = false;
this.disconnected = true;
this.emit('disconnect', reason);
};
/**
* Called with socket packet.
*
* @param {Object} packet
* @api private
*/
Socket.prototype.onpacket = function(packet){
if (packet.nsp != this.nsp) return;
switch (packet.type) {
case parser.CONNECT:
this.onconnect();
break;
case parser.EVENT:
this.onevent(packet);
break;
case parser.BINARY_EVENT:
this.onevent(packet);
break;
case parser.ACK:
this.onack(packet);
break;
case parser.BINARY_ACK:
this.onack(packet);
break;
case parser.DISCONNECT:
this.ondisconnect();
break;
case parser.ERROR:
this.emit('error', packet.data);
break;
}
};
/**
* Called upon a server event.
*
* @param {Object} packet
* @api private
*/
Socket.prototype.onevent = function(packet){
var args = packet.data || [];
debug('emitting event %j', args);
if (null != packet.id) {
debug('attaching ack callback to event');
args.push(this.ack(packet.id));
}
if (this.connected) {
emit.apply(this, args);
} else {
this.receiveBuffer.push(args);
}
};
/**
* Produces an ack callback to emit with an event.
*
* @api private
*/
Socket.prototype.ack = function(id){
var self = this;
var sent = false;
return function(){
// prevent double callbacks
if (sent) return;
sent = true;
var args = toArray(arguments);
debug('sending ack %j', args);
var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;
self.packet({
type: type,
id: id,
data: args
});
};
};
/**
* Called upon a server acknowlegement.
*
* @param {Object} packet
* @api private
*/
Socket.prototype.onack = function(packet){
debug('calling ack %s with %j', packet.id, packet.data);
var fn = this.acks[packet.id];
fn.apply(this, packet.data);
delete this.acks[packet.id];
};
/**
* Called upon server connect.
*
* @api private
*/
Socket.prototype.onconnect = function(){
this.connected = true;
this.disconnected = false;
this.emit('connect');
this.emitBuffered();
};
/**
* Emit buffered events (received and emitted).
*
* @api private
*/
Socket.prototype.emitBuffered = function(){
var i;
for (i = 0; i < this.receiveBuffer.length; i++) {
emit.apply(this, this.receiveBuffer[i]);
}
this.receiveBuffer = [];
for (i = 0; i < this.sendBuffer.length; i++) {
this.packet(this.sendBuffer[i]);
}
this.sendBuffer = [];
};
/**
* Called upon server disconnect.
*
* @api private
*/
Socket.prototype.ondisconnect = function(){
debug('server disconnect (%s)', this.nsp);
this.destroy();
this.onclose('io server disconnect');
};
/**
* Called upon forced client/server side disconnections,
* this method ensures the manager stops tracking us and
* that reconnections don't get triggered for this.
*
* @api private.
*/
Socket.prototype.destroy = function(){
if (this.subs) {
// clean subscriptions to avoid reconnections
for (var i = 0; i < this.subs.length; i++) {
this.subs[i].destroy();
}
this.subs = null;
}
this.io.destroy(this);
};
/**
* Disconnects the socket manually.
*
* @return {Socket} self
* @api public
*/
Socket.prototype.close =
Socket.prototype.disconnect = function(){
if (this.connected) {
debug('performing disconnect (%s)', this.nsp);
this.packet({ type: parser.DISCONNECT });
}
// remove socket from pool
this.destroy();
if (this.connected) {
// fire events
this.onclose('io client disconnect');
}
return this;
};

73
node_modules/socket.io-client/lib/url.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
/**
* Module dependencies.
*/
var parseuri = require('parseuri');
var debug = require('debug')('socket.io-client:url');
/**
* Module exports.
*/
module.exports = url;
/**
* URL parser.
*
* @param {String} url
* @param {Object} An object meant to mimic window.location.
* Defaults to window.location.
* @api public
*/
function url(uri, loc){
var obj = uri;
// default to window.location
var loc = loc || global.location;
if (null == uri) uri = loc.protocol + '//' + loc.hostname;
// relative path support
if ('string' == typeof uri) {
if ('/' == uri.charAt(0)) {
if ('/' == uri.charAt(1)) {
uri = loc.protocol + uri;
} else {
uri = loc.hostname + uri;
}
}
if (!/^(https?|wss?):\/\//.test(uri)) {
debug('protocol-less url %s', uri);
if ('undefined' != typeof loc) {
uri = loc.protocol + '//' + uri;
} else {
uri = 'https://' + uri;
}
}
// parse
debug('parse %s', uri);
obj = parseuri(uri);
}
// make sure we treat `localhost:80` and `localhost` equally
if (!obj.port) {
if (/^(http|ws)$/.test(obj.protocol)) {
obj.port = '80';
}
else if (/^(http|ws)s$/.test(obj.protocol)) {
obj.port = '443';
}
}
obj.path = obj.path || '/';
// define unique id
obj.id = obj.protocol + '://' + obj.host + ':' + obj.port;
// define href
obj.href = obj.protocol + '://' + obj.host + (loc && loc.port == obj.port ? '' : (':' + obj.port));
return obj;
}

View File

@@ -0,0 +1,115 @@
# debug
tiny node.js debugging utility modelled after node core's debugging technique.
## Installation
```
$ npm install debug
```
## Usage
With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
Example _app.js_:
```js
var debug = require('debug')('http')
, http = require('http')
, name = 'My App';
// fake app
debug('booting %s', name);
http.createServer(function(req, res){
debug(req.method + ' ' + req.url);
res.end('hello\n');
}).listen(3000, function(){
debug('listening');
});
// fake worker of some kind
require('./worker');
```
Example _worker.js_:
```js
var debug = require('debug')('worker');
setInterval(function(){
debug('doing some work');
}, 1000);
```
The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
## Millisecond diff
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
When stderr is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
_(NOTE: Debug now uses stderr instead of stdout, so the correct shell command for this example is actually `DEBUG=* node example/worker 2> out &`)_
![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
## Conventions
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
## Wildcards
The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:".
## Browser support
Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`.
```js
a = debug('worker:a');
b = debug('worker:b');
setInterval(function(){
a('doing some work');
}, 1000);
setInterval(function(){
a('doing some work');
}, 1200);
```
## License
(The MIT License)
Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,137 @@
/**
* Expose `debug()` as the module.
*/
module.exports = debug;
/**
* Create a debugger with the given `name`.
*
* @param {String} name
* @return {Type}
* @api public
*/
function debug(name) {
if (!debug.enabled(name)) return function(){};
return function(fmt){
fmt = coerce(fmt);
var curr = new Date;
var ms = curr - (debug[name] || curr);
debug[name] = curr;
fmt = name
+ ' '
+ fmt
+ ' +' + debug.humanize(ms);
// This hackery is required for IE8
// where `console.log` doesn't have 'apply'
window.console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
}
/**
* The currently active debug mode names.
*/
debug.names = [];
debug.skips = [];
/**
* Enables a debug mode by name. This can include modes
* separated by a colon and wildcards.
*
* @param {String} name
* @api public
*/
debug.enable = function(name) {
try {
localStorage.debug = name;
} catch(e){}
var split = (name || '').split(/[\s,]+/)
, len = split.length;
for (var i = 0; i < len; i++) {
name = split[i].replace('*', '.*?');
if (name[0] === '-') {
debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
}
else {
debug.names.push(new RegExp('^' + name + '$'));
}
}
};
/**
* Disable debug output.
*
* @api public
*/
debug.disable = function(){
debug.enable('');
};
/**
* Humanize the given `ms`.
*
* @param {Number} m
* @return {String}
* @api private
*/
debug.humanize = function(ms) {
var sec = 1000
, min = 60 * 1000
, hour = 60 * min;
if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
if (ms >= min) return (ms / min).toFixed(1) + 'm';
if (ms >= sec) return (ms / sec | 0) + 's';
return ms + 'ms';
};
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
debug.enabled = function(name) {
for (var i = 0, len = debug.skips.length; i < len; i++) {
if (debug.skips[i].test(name)) {
return false;
}
}
for (var i = 0, len = debug.names.length; i < len; i++) {
if (debug.names[i].test(name)) {
return true;
}
}
return false;
};
/**
* Coerce `val`.
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
// persist
try {
if (window.localStorage) debug.enable(localStorage.debug);
} catch(e){}

View File

@@ -0,0 +1,5 @@
if ('undefined' == typeof window) {
module.exports = require('./lib/debug');
} else {
module.exports = require('./debug');
}

View File

@@ -0,0 +1,147 @@
/**
* Module dependencies.
*/
var tty = require('tty');
/**
* Expose `debug()` as the module.
*/
module.exports = debug;
/**
* Enabled debuggers.
*/
var names = []
, skips = [];
(process.env.DEBUG || '')
.split(/[\s,]+/)
.forEach(function(name){
name = name.replace('*', '.*?');
if (name[0] === '-') {
skips.push(new RegExp('^' + name.substr(1) + '$'));
} else {
names.push(new RegExp('^' + name + '$'));
}
});
/**
* Colors.
*/
var colors = [6, 2, 3, 4, 5, 1];
/**
* Previous debug() call.
*/
var prev = {};
/**
* Previously assigned color.
*/
var prevColor = 0;
/**
* Is stdout a TTY? Colored output is disabled when `true`.
*/
var isatty = tty.isatty(2);
/**
* Select a color.
*
* @return {Number}
* @api private
*/
function color() {
return colors[prevColor++ % colors.length];
}
/**
* Humanize the given `ms`.
*
* @param {Number} m
* @return {String}
* @api private
*/
function humanize(ms) {
var sec = 1000
, min = 60 * 1000
, hour = 60 * min;
if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
if (ms >= min) return (ms / min).toFixed(1) + 'm';
if (ms >= sec) return (ms / sec | 0) + 's';
return ms + 'ms';
}
/**
* Create a debugger with the given `name`.
*
* @param {String} name
* @return {Type}
* @api public
*/
function debug(name) {
function disabled(){}
disabled.enabled = false;
var match = skips.some(function(re){
return re.test(name);
});
if (match) return disabled;
match = names.some(function(re){
return re.test(name);
});
if (!match) return disabled;
var c = color();
function colored(fmt) {
fmt = coerce(fmt);
var curr = new Date;
var ms = curr - (prev[name] || curr);
prev[name] = curr;
fmt = ' \u001b[9' + c + 'm' + name + ' '
+ '\u001b[3' + c + 'm\u001b[90m'
+ fmt + '\u001b[3' + c + 'm'
+ ' +' + humanize(ms) + '\u001b[0m';
console.error.apply(this, arguments);
}
function plain(fmt) {
fmt = coerce(fmt);
fmt = new Date().toUTCString()
+ ' ' + name + ' ' + fmt;
console.error.apply(this, arguments);
}
colored.enabled = plain.enabled = true;
return isatty || process.env.DEBUG_COLORS
? colored
: plain;
}
/**
* Coerce `val`.
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}

View File

@@ -0,0 +1,88 @@
{
"_args": [
[
"debug@0.7.4",
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-client"
]
],
"_from": "debug@0.7.4",
"_id": "debug@0.7.4",
"_inCache": true,
"_installable": true,
"_location": "/socket.io-client/debug",
"_npmUser": {
"email": "tj@vision-media.ca",
"name": "tjholowaychuk"
},
"_npmVersion": "1.3.13",
"_phantomChildren": {},
"_requested": {
"name": "debug",
"raw": "debug@0.7.4",
"rawSpec": "0.7.4",
"scope": null,
"spec": "0.7.4",
"type": "version"
},
"_requiredBy": [
"/socket.io-client"
],
"_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz",
"_shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39",
"_shrinkwrap": null,
"_spec": "debug@0.7.4",
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-client",
"author": {
"email": "tj@vision-media.ca",
"name": "TJ Holowaychuk"
},
"browser": "./debug.js",
"bugs": {
"url": "https://github.com/visionmedia/debug/issues"
},
"component": {
"scripts": {
"debug/debug.js": "debug.js",
"debug/index.js": "index.js"
}
},
"dependencies": {},
"description": "small debugging utility",
"devDependencies": {
"mocha": "*"
},
"directories": {},
"dist": {
"shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39",
"tarball": "http://registry.npmjs.org/debug/-/debug-0.7.4.tgz"
},
"engines": {
"node": "*"
},
"files": [
"lib/debug.js",
"debug.js",
"index.js"
],
"homepage": "https://github.com/visionmedia/debug",
"keywords": [
"debug",
"log",
"debugger"
],
"main": "lib/debug.js",
"maintainers": [
{
"email": "tj@vision-media.ca",
"name": "tjholowaychuk"
}
],
"name": "debug",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/visionmedia/debug.git"
},
"version": "0.7.4"
}

114
node_modules/socket.io-client/package.json generated vendored Normal file
View File

@@ -0,0 +1,114 @@
{
"_args": [
[
"socket.io-client@1.2.0",
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io"
]
],
"_from": "socket.io-client@1.2.0",
"_id": "socket.io-client@1.2.0",
"_inCache": true,
"_installable": true,
"_location": "/socket.io-client",
"_npmUser": {
"email": "rauchg@gmail.com",
"name": "rauchg"
},
"_npmVersion": "1.4.21",
"_phantomChildren": {},
"_requested": {
"name": "socket.io-client",
"raw": "socket.io-client@1.2.0",
"rawSpec": "1.2.0",
"scope": null,
"spec": "1.2.0",
"type": "version"
},
"_requiredBy": [
"/socket.io"
],
"_resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.2.0.tgz",
"_shasum": "1268bd3fb182fff3afa44e126f1230d63b8d161d",
"_shrinkwrap": null,
"_spec": "socket.io-client@1.2.0",
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io",
"bugs": {
"url": "https://github.com/Automattic/socket.io-client/issues"
},
"contributors": [
{
"email": "rauchg@gmail.com",
"name": "Guillermo Rauch"
},
{
"email": "info@3rd-eden.com",
"name": "Arnout Kazemier"
},
{
"email": "dronnikov@gmail.com",
"name": "Vladimir Dronnikov"
},
{
"email": "einaros@gmail.com",
"name": "Einar Otto Stangvik"
}
],
"dependencies": {
"component-bind": "1.0.0",
"component-emitter": "1.1.2",
"debug": "0.7.4",
"engine.io-client": "1.4.2",
"has-binary": "0.1.5",
"indexof": "0.0.1",
"object-component": "0.0.3",
"parseuri": "0.0.2",
"socket.io-parser": "2.2.2",
"to-array": "0.1.3"
},
"description": "[![Build Status](https://secure.travis-ci.org/Automattic/socket.io-client.svg)](http://travis-ci.org/Automattic/socket.io-client) [![NPM version](https://badge.fury.io/js/socket.io-client.svg)](http://badge.fury.io/js/socket.io-client) ![Downloads](http:/",
"devDependencies": {
"base64-arraybuffer": "0.1.0",
"browserify": "4.2.1",
"expect.js": "0.2.0",
"has-cors": "1.0.3",
"istanbul": "0.2.1",
"mocha": "1.16.2",
"socket.io": "1.2.0",
"text-blob-builder": "0.0.1",
"uglify-js": "2.4.8",
"zuul": "1.10.2"
},
"directories": {},
"dist": {
"shasum": "1268bd3fb182fff3afa44e126f1230d63b8d161d",
"tarball": "http://registry.npmjs.org/socket.io-client/-/socket.io-client-1.2.0.tgz"
},
"gitHead": "295be0bda9ae1dd198eddfc03f1280efbe7084dc",
"homepage": "https://github.com/Automattic/socket.io-client",
"keywords": [
"realtime",
"framework",
"websocket",
"tcp",
"events",
"client"
],
"license": "MIT",
"maintainers": [
{
"email": "rauchg@gmail.com",
"name": "rauchg"
}
],
"name": "socket.io-client",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/Automattic/socket.io-client.git"
},
"scripts": {
"test": "make test"
},
"version": "1.2.0"
}

6252
node_modules/socket.io-client/socket.io.js generated vendored Normal file

File diff suppressed because it is too large Load Diff