aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components
diff options
context:
space:
mode:
Diffstat (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/components')
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json14
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js24
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json13
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js147
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json15
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js486
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json17
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js4
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json24
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js52
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js2
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js163
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js492
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js141
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js254
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js62
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js221
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-xhr.js288
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling.js210
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/websocket.js158
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/util.js265
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/component.json12
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/index.js177
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/component.json16
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/index.js27
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/component.json16
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/debug.js122
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/index.js5
28 files changed, 3427 insertions, 0 deletions
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json
new file mode 100644
index 0000000..ebdf642
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json
@@ -0,0 +1,14 @@
+{
+ "name": "bind",
+ "version": "0.0.1",
+ "description": "function binding utility",
+ "keywords": [
+ "bind",
+ "utility"
+ ],
+ "dependencies": {},
+ "scripts": [
+ "index.js"
+ ],
+ "repo": "https://raw.github.com/component/bind"
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
new file mode 100644
index 0000000..9808fc0
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
@@ -0,0 +1,24 @@
+
+/**
+ * Slice reference.
+ */
+
+var slice = [].slice;
+
+/**
+ * Bind `obj` to `fn`.
+ *
+ * @param {Object} obj
+ * @param {Function|String} fn or string
+ * @return {Function}
+ * @api public
+ */
+
+module.exports = function(obj, fn){
+ if ('string' == typeof fn) fn = obj[fn];
+ if ('function' != typeof fn) throw new Error('bind() requires a function');
+ var args = [].slice.call(arguments, 2);
+ return function(){
+ return fn.apply(obj, args.concat(slice.call(arguments)));
+ }
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json
new file mode 100644
index 0000000..0eec23b
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json
@@ -0,0 +1,13 @@
+{
+ "name": "emitter",
+ "description": "Event emitter",
+ "keywords": [
+ "emitter",
+ "events"
+ ],
+ "version": "0.0.6",
+ "scripts": [
+ "index.js"
+ ],
+ "repo": "https://raw.github.com/component/emitter"
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js
new file mode 100644
index 0000000..8cc74ae
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js
@@ -0,0 +1,147 @@
+
+/**
+ * Expose `Emitter`.
+ */
+
+module.exports = Emitter;
+
+/**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+function Emitter(obj) {
+ if (obj) return mixin(obj);
+};
+
+/**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+}
+
+/**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.on = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
+};
+
+/**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ fn._off = on;
+ this.on(event, on);
+ return this;
+};
+
+/**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+Emitter.prototype.off = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ var i = callbacks.indexOf(fn._off || fn);
+ if (~i) callbacks.splice(i, 1);
+ return this;
+};
+
+/**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+};
+
+/**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+};
+
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json
new file mode 100644
index 0000000..6b35f45
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json
@@ -0,0 +1,15 @@
+{
+ "name": "json-fallback",
+ "repo": "component/json",
+ "description": "JSON parser / stringifier fallback",
+ "version": "0.0.1",
+ "keywords": [
+ "json",
+ "fallback"
+ ],
+ "dependencies": {},
+ "development": {},
+ "scripts": [
+ "index.js"
+ ]
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js
new file mode 100644
index 0000000..5a47ca6
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js
@@ -0,0 +1,486 @@
+/*
+ json2.js
+ 2011-10-19
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or '&nbsp;'),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+*/
+
+/*jslint evil: true, regexp: true */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, prototype, push, replace, slice, stringify,
+ test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+var JSON = {};
+
+(function () {
+ 'use strict';
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf())
+ ? this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z'
+ : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string'
+ ? c
+ : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' : '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0
+ ? '[]'
+ : gap
+ ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
+ : '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ if (typeof rep[i] === 'string') {
+ k = rep[i];
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0
+ ? '{}'
+ : gap
+ ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
+ : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/
+ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function'
+ ? walk({'': j}, '')
+ : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+}());
+
+module.exports = JSON \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json
new file mode 100644
index 0000000..da7097c
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json
@@ -0,0 +1,17 @@
+{
+ "name": "json",
+ "repo": "component/json",
+ "description": "JSON parser / stringifier",
+ "version": "0.0.1",
+ "keywords": [
+ "json"
+ ],
+ "dependencies": {},
+ "development": {},
+ "optional": {
+ "component/json-fallback": "*"
+ },
+ "scripts": [
+ "index.js"
+ ]
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js
new file mode 100644
index 0000000..c05cc28
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js
@@ -0,0 +1,4 @@
+
+module.exports = 'undefined' == typeof JSON
+ ? require('json-fallback')
+ : JSON;
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json
new file mode 100644
index 0000000..b90c1f2
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json
@@ -0,0 +1,24 @@
+{
+ "name": "engine.io",
+ "version": "0.4.0",
+ "dependencies": {
+ "component/emitter": "0.0.6",
+ "visionmedia/debug": "*"
+ },
+ "main": "lib/index.js",
+ "scripts": [
+ "lib/index.js",
+ "lib/parser.js",
+ "lib/socket.js",
+ "lib/transport.js",
+ "lib/emitter.js",
+ "lib/util.js",
+ "lib/transports/index.js",
+ "lib/transports/polling.js",
+ "lib/transports/polling-xhr.js",
+ "lib/transports/polling-jsonp.js",
+ "lib/transports/websocket.js",
+ "lib/transports/flashsocket.js"
+ ],
+ "repo": "https://raw.github.com/learnboost/engine.io-client"
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js
new file mode 100644
index 0000000..142a9bf
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js
@@ -0,0 +1,52 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Emitter;
+
+try {
+ Emitter = require('emitter');
+} catch(e){
+ Emitter = require('emitter-component');
+}
+
+/**
+ * Module exports.
+ */
+
+module.exports = Emitter;
+
+/**
+ * Compatibility with `WebSocket#addEventListener`.
+ *
+ * @api public
+ */
+
+Emitter.prototype.addEventListener = Emitter.prototype.on;
+
+/**
+ * Compatibility with `WebSocket#removeEventListener`.
+ *
+ * @api public
+ */
+
+Emitter.prototype.removeEventListener = Emitter.prototype.off;
+
+/**
+ * Node-compatible `EventEmitter#removeListener`
+ *
+ * @api public
+ */
+
+Emitter.prototype.removeListener = Emitter.prototype.off;
+
+/**
+ * Node-compatible `EventEmitter#removeAllListeners`
+ *
+ * @api public
+ */
+
+Emitter.prototype.removeAllListeners = function(){
+ this._callbacks = {};
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js
new file mode 100644
index 0000000..d463b3f
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./socket');
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js
new file mode 100644
index 0000000..2c2928e
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js
@@ -0,0 +1,163 @@
+/**
+ * Module dependencies.
+ */
+
+var util = require('./util')
+
+/**
+ * Packet types.
+ */
+
+var packets = exports.packets = {
+ open: 0 // non-ws
+ , close: 1 // non-ws
+ , ping: 2
+ , pong: 3
+ , message: 4
+ , upgrade: 5
+ , noop: 6
+};
+
+var packetslist = util.keys(packets);
+
+/**
+ * Premade error packet.
+ */
+
+var err = { type: 'error', data: 'parser error' }
+
+/**
+ * Encodes a packet.
+ *
+ * <packet type id> [ `:` <data> ]
+ *
+ * Example:
+ *
+ * 5:hello world
+ * 3
+ * 4
+ *
+ * @api private
+ */
+
+exports.encodePacket = function (packet) {
+ var encoded = packets[packet.type]
+
+ // data fragment is optional
+ if (undefined !== packet.data) {
+ encoded += String(packet.data);
+ }
+
+ return '' + encoded;
+};
+
+/**
+ * Decodes a packet.
+ *
+ * @return {Object} with `type` and `data` (if any)
+ * @api private
+ */
+
+exports.decodePacket = function (data) {
+ var type = data.charAt(0);
+
+ if (Number(type) != type || !packetslist[type]) {
+ return err;
+ }
+
+ if (data.length > 1) {
+ return { type: packetslist[type], data: data.substring(1) };
+ } else {
+ return { type: packetslist[type] };
+ }
+};
+
+/**
+ * Encodes multiple messages (payload).
+ *
+ * <length>:data
+ *
+ * Example:
+ *
+ * 11:hello world2:hi
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+exports.encodePayload = function (packets) {
+ if (!packets.length) {
+ return '0:';
+ }
+
+ var encoded = ''
+ , message
+
+ for (var i = 0, l = packets.length; i < l; i++) {
+ message = exports.encodePacket(packets[i]);
+ encoded += message.length + ':' + message;
+ }
+
+ return encoded;
+};
+
+/*
+ * Decodes data when a payload is maybe expected.
+ *
+ * @param {String} data
+ * @return {Array} packets
+ * @api public
+ */
+
+exports.decodePayload = function (data) {
+ if (data == '') {
+ // parser error - ignoring payload
+ return [err];
+ }
+
+ var packets = []
+ , length = ''
+ , n, msg, packet
+
+ for (var i = 0, l = data.length; i < l; i++) {
+ var chr = data.charAt(i)
+
+ if (':' != chr) {
+ length += chr;
+ } else {
+ if ('' == length || (length != (n = Number(length)))) {
+ // parser error - ignoring payload
+ return [err];
+ }
+
+ msg = data.substr(i + 1, n);
+
+ if (length != msg.length) {
+ // parser error - ignoring payload
+ return [err];
+ }
+
+ if (msg.length) {
+ packet = exports.decodePacket(msg);
+
+ if (err.type == packet.type && err.data == packet.data) {
+ // parser error in individual packet - ignoring payload
+ return [err];
+ }
+
+ packets.push(packet);
+ }
+
+ // advance cursor
+ i += n;
+ length = ''
+ }
+ }
+
+ if (length != '') {
+ // parser error - ignoring payload
+ return [err];
+ }
+
+ return packets;
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js
new file mode 100644
index 0000000..ad86283
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js
@@ -0,0 +1,492 @@
+/**
+ * Module dependencies.
+ */
+
+var util = require('./util')
+ , transports = require('./transports')
+ , Emitter = require('./emitter')
+ , debug = require('debug')('engine-client:socket');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Socket;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Socket constructor.
+ *
+ * @param {Object} options
+ * @api public
+ */
+
+function Socket(opts){
+ if (!(this instanceof Socket)) return new Socket(opts);
+
+ if ('string' == typeof opts) {
+ var uri = util.parseUri(opts);
+ opts = arguments[1] || {};
+ opts.host = uri.host;
+ opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';
+ opts.port = uri.port;
+ }
+
+ opts = opts || {};
+ this.secure = null != opts.secure ? opts.secure : (global.location && 'https:' == location.protocol);
+ this.host = opts.host || opts.hostname || (global.location ? location.hostname : 'localhost');
+ this.port = opts.port || (global.location && location.port ? location.port : (this.secure ? 443 : 80));
+ this.query = opts.query || {};
+ this.query.uid = rnd();
+ this.upgrade = false !== opts.upgrade;
+ this.resource = opts.resource || 'default';
+ this.path = (opts.path || '/engine.io').replace(/\/$/, '');
+ this.path += '/' + this.resource + '/';
+ this.forceJSONP = !!opts.forceJSONP;
+ this.timestampParam = opts.timestampParam || 't';
+ this.timestampRequests = !!opts.timestampRequests;
+ this.flashPath = opts.flashPath || '';
+ this.transports = opts.transports || ['polling', 'websocket', 'flashsocket'];
+ this.readyState = '';
+ this.writeBuffer = [];
+ this.policyPort = opts.policyPort || 843;
+ this.open();
+
+ Socket.sockets.push(this);
+ Socket.sockets.evs.emit('add', this);
+};
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Socket.prototype);
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+Socket.protocol = 1;
+
+/**
+ * Static EventEmitter.
+ */
+
+Socket.sockets = [];
+Socket.sockets.evs = new Emitter;
+
+/**
+ * Expose deps for legacy compatibility
+ * and standalone browser access.
+ */
+
+Socket.Socket = Socket;
+Socket.Transport = require('./transport');
+Socket.Emitter = require('./emitter');
+Socket.transports = require('./transports');
+Socket.util = require('./util');
+Socket.parser = require('./parser');
+
+/**
+ * Creates transport of the given type.
+ *
+ * @param {String} transport name
+ * @return {Transport}
+ * @api private
+ */
+
+Socket.prototype.createTransport = function (name) {
+ debug('creating transport "%s"', name);
+ var query = clone(this.query);
+ query.transport = name;
+
+ if (this.id) {
+ query.sid = this.id;
+ }
+
+ var transport = new transports[name]({
+ host: this.host
+ , port: this.port
+ , secure: this.secure
+ , path: this.path
+ , query: query
+ , forceJSONP: this.forceJSONP
+ , timestampRequests: this.timestampRequests
+ , timestampParam: this.timestampParam
+ , flashPath: this.flashPath
+ , policyPort: this.policyPort
+ });
+
+ return transport;
+};
+
+function clone (obj) {
+ var o = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ o[i] = obj[i];
+ }
+ }
+ return o;
+}
+
+/**
+ * Initializes transport to use and starts probe.
+ *
+ * @api private
+ */
+
+Socket.prototype.open = function () {
+ this.readyState = 'opening';
+ var transport = this.createTransport(this.transports[0]);
+ transport.open();
+ this.setTransport(transport);
+};
+
+/**
+ * Sets the current transport. Disables the existing one (if any).
+ *
+ * @api private
+ */
+
+Socket.prototype.setTransport = function (transport) {
+ var self = this;
+
+ if (this.transport) {
+ debug('clearing existing transport');
+ this.transport.removeAllListeners();
+ }
+
+ // set up transport
+ this.transport = transport;
+
+ // set up transport listeners
+ transport
+ .on('drain', function () {
+ self.flush();
+ })
+ .on('packet', function (packet) {
+ self.onPacket(packet);
+ })
+ .on('error', function (e) {
+ self.onError(e);
+ })
+ .on('close', function () {
+ self.onClose('transport close');
+ });
+};
+
+/**
+ * Probes a transport.
+ *
+ * @param {String} transport name
+ * @api private
+ */
+
+Socket.prototype.probe = function (name) {
+ debug('probing transport "%s"', name);
+ var transport = this.createTransport(name, { probe: 1 })
+ , failed = false
+ , self = this;
+
+ transport.once('open', function () {
+ if (failed) return;
+
+ debug('probe transport "%s" opened', name);
+ transport.send([{ type: 'ping', data: 'probe' }]);
+ transport.once('packet', function (msg) {
+ if (failed) return;
+ if ('pong' == msg.type && 'probe' == msg.data) {
+ debug('probe transport "%s" pong', name);
+ self.upgrading = true;
+ self.emit('upgrading', transport);
+
+ debug('pausing current transport "%s"', self.transport.name);
+ self.transport.pause(function () {
+ if (failed) return;
+ if ('closed' == self.readyState || 'closing' == self.readyState) {
+ return;
+ }
+ debug('changing transport and sending upgrade packet');
+ transport.removeListener('error', onerror);
+ self.emit('upgrade', transport);
+ self.setTransport(transport);
+ transport.send([{ type: 'upgrade' }]);
+ transport = null;
+ self.upgrading = false;
+ self.flush();
+ });
+ } else {
+ debug('probe transport "%s" failed', name);
+ var err = new Error('probe error');
+ err.transport = transport.name;
+ self.emit('error', err);
+ }
+ });
+ });
+
+ transport.once('error', onerror);
+ function onerror(err) {
+ if (failed) return;
+
+ // Any callback called by transport should be ignored since now
+ failed = true;
+
+ var error = new Error('probe error: ' + err);
+ error.transport = transport.name;
+
+ transport.close();
+ transport = null;
+
+ debug('probe transport "%s" failed because of error: %s', name, err);
+
+ self.emit('error', error);
+ };
+
+ transport.open();
+
+ this.once('close', function () {
+ if (transport) {
+ debug('socket closed prematurely - aborting probe');
+ failed = true;
+ transport.close();
+ transport = null;
+ }
+ });
+
+ this.once('upgrading', function (to) {
+ if (transport && to.name != transport.name) {
+ debug('"%s" works - aborting "%s"', to.name, transport.name);
+ transport.close();
+ transport = null;
+ }
+ });
+};
+
+/**
+ * Called when connection is deemed open.
+ *
+ * @api public
+ */
+
+Socket.prototype.onOpen = function () {
+ debug('socket open');
+ this.readyState = 'open';
+ this.emit('open');
+ this.onopen && this.onopen.call(this);
+ this.flush();
+
+ // we check for `readyState` in case an `open`
+ // listener alreay closed the socket
+ if ('open' == this.readyState && this.upgrade && this.transport.pause) {
+ debug('starting upgrade probes');
+ for (var i = 0, l = this.upgrades.length; i < l; i++) {
+ this.probe(this.upgrades[i]);
+ }
+ }
+};
+
+/**
+ * Handles a packet.
+ *
+ * @api private
+ */
+
+Socket.prototype.onPacket = function (packet) {
+ if ('opening' == this.readyState || 'open' == this.readyState) {
+ debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
+
+ this.emit('packet', packet);
+
+ // Socket is live - any packet counts
+ this.emit('heartbeat');
+
+ switch (packet.type) {
+ case 'open':
+ this.onHandshake(util.parseJSON(packet.data));
+ break;
+
+ case 'pong':
+ this.ping();
+ break;
+
+ case 'error':
+ var err = new Error('server error');
+ err.code = packet.data;
+ this.emit('error', err);
+ break;
+
+ case 'message':
+ this.emit('message', packet.data);
+ var event = { data: packet.data };
+ event.toString = function () {
+ return packet.data;
+ };
+ this.onmessage && this.onmessage.call(this, event);
+ break;
+ }
+ } else {
+ debug('packet received with socket readyState "%s"', this.readyState);
+ }
+};
+
+/**
+ * Called upon handshake completion.
+ *
+ * @param {Object} handshake obj
+ * @api private
+ */
+
+Socket.prototype.onHandshake = function (data) {
+ this.emit('handshake', data);
+ this.id = data.sid;
+ this.transport.query.sid = data.sid;
+ this.upgrades = data.upgrades;
+ this.pingInterval = data.pingInterval;
+ this.pingTimeout = data.pingTimeout;
+ this.onOpen();
+ this.ping();
+
+ // Prolong liveness of socket on heartbeat
+ this.removeListener('heartbeat', this.onHeartbeat);
+ this.on('heartbeat', this.onHeartbeat);
+};
+
+/**
+ * Resets ping timeout.
+ *
+ * @api private
+ */
+
+Socket.prototype.onHeartbeat = function (timeout) {
+ clearTimeout(this.pingTimeoutTimer);
+ var self = this;
+ self.pingTimeoutTimer = setTimeout(function () {
+ if ('closed' == self.readyState) return;
+ self.onClose('ping timeout');
+ }, timeout || (self.pingInterval + self.pingTimeout));
+};
+
+/**
+ * Pings server every `this.pingInterval` and expects response
+ * within `this.pingTimeout` or closes connection.
+ *
+ * @api private
+ */
+
+Socket.prototype.ping = function () {
+ var self = this;
+ clearTimeout(self.pingIntervalTimer);
+ self.pingIntervalTimer = setTimeout(function () {
+ debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
+ self.sendPacket('ping');
+ self.onHeartbeat(self.pingTimeout);
+ }, self.pingInterval);
+};
+
+/**
+ * Flush write buffers.
+ *
+ * @api private
+ */
+
+Socket.prototype.flush = function () {
+ if ('closed' != this.readyState && this.transport.writable &&
+ !this.upgrading && this.writeBuffer.length) {
+ debug('flushing %d packets in socket', this.writeBuffer.length);
+ this.transport.send(this.writeBuffer);
+ this.writeBuffer = [];
+ }
+};
+
+/**
+ * Sends a message.
+ *
+ * @param {String} message.
+ * @return {Socket} for chaining.
+ * @api public
+ */
+
+Socket.prototype.write =
+Socket.prototype.send = function (msg) {
+ this.sendPacket('message', msg);
+ return this;
+};
+
+/**
+ * Sends a packet.
+ *
+ * @param {String} packet type.
+ * @param {String} data.
+ * @api private
+ */
+
+Socket.prototype.sendPacket = function (type, data) {
+ var packet = { type: type, data: data };
+ this.emit('packetCreate', packet);
+ this.writeBuffer.push(packet);
+ this.flush();
+};
+
+/**
+ * Closes the connection.
+ *
+ * @api private
+ */
+
+Socket.prototype.close = function () {
+ if ('opening' == this.readyState || 'open' == this.readyState) {
+ this.onClose('forced close');
+ debug('socket closing - telling transport to close');
+ this.transport.close();
+ this.transport.removeAllListeners();
+ }
+
+ return this;
+};
+
+/**
+ * Called upon transport error
+ *
+ * @api private
+ */
+
+Socket.prototype.onError = function (err) {
+ this.emit('error', err);
+ this.onClose('transport error', err);
+};
+
+/**
+ * Called upon transport close.
+ *
+ * @api private
+ */
+
+Socket.prototype.onClose = function (reason, desc) {
+ if ('closed' != this.readyState) {
+ debug('socket close with reason: "%s"', reason);
+ clearTimeout(this.pingIntervalTimer);
+ clearTimeout(this.pingTimeoutTimer);
+ this.readyState = 'closed';
+ this.emit('close', reason, desc);
+ this.onclose && this.onclose.call(this);
+ this.id = null;
+ }
+};
+
+/**
+ * Generates a random uid.
+ *
+ * @api private
+ */
+
+function rnd () {
+ return String(Math.random()).substr(5) + String(Math.random()).substr(5);
+}
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js
new file mode 100644
index 0000000..5760f84
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js
@@ -0,0 +1,141 @@
+
+/**
+ * Module dependencies.
+ */
+
+var util = require('./util')
+ , parser = require('./parser')
+ , Emitter = require('./emitter');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Transport;
+
+/**
+ * Transport abstract constructor.
+ *
+ * @param {Object} options.
+ * @api private
+ */
+
+function Transport (opts) {
+ this.path = opts.path;
+ this.host = opts.host;
+ this.port = opts.port;
+ this.secure = opts.secure;
+ this.query = opts.query;
+ this.timestampParam = opts.timestampParam;
+ this.timestampRequests = opts.timestampRequests;
+ this.readyState = '';
+};
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Transport.prototype);
+
+/**
+ * Emits an error.
+ *
+ * @param {String} str
+ * @return {Transport} for chaining
+ * @api public
+ */
+
+Transport.prototype.onError = function (msg, desc) {
+ var err = new Error(msg);
+ err.type = 'TransportError';
+ err.description = desc;
+ this.emit('error', err);
+ return this;
+};
+
+/**
+ * Opens the transport.
+ *
+ * @api public
+ */
+
+Transport.prototype.open = function () {
+ if ('closed' == this.readyState || '' == this.readyState) {
+ this.readyState = 'opening';
+ this.doOpen();
+ }
+
+ return this;
+};
+
+/**
+ * Closes the transport.
+ *
+ * @api private
+ */
+
+Transport.prototype.close = function () {
+ if ('opening' == this.readyState || 'open' == this.readyState) {
+ this.doClose();
+ this.onClose();
+ }
+
+ return this;
+};
+
+/**
+ * Sends multiple packets.
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+Transport.prototype.send = function(packets){
+ if ('open' == this.readyState) {
+ this.write(packets);
+ } else {
+ throw new Error('Transport not open');
+ }
+};
+
+/**
+ * Called upon open
+ *
+ * @api private
+ */
+
+Transport.prototype.onOpen = function () {
+ this.readyState = 'open';
+ this.writable = true;
+ this.emit('open');
+};
+
+/**
+ * Called with data.
+ *
+ * @param {String} data
+ * @api private
+ */
+
+Transport.prototype.onData = function (data) {
+ this.onPacket(parser.decodePacket(data));
+};
+
+/**
+ * Called with a decoded packet.
+ */
+
+Transport.prototype.onPacket = function (packet) {
+ this.emit('packet', packet);
+};
+
+/**
+ * Called upon close.
+ *
+ * @api private
+ */
+
+Transport.prototype.onClose = function () {
+ this.readyState = 'closed';
+ this.emit('close');
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js
new file mode 100644
index 0000000..9a5a108
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js
@@ -0,0 +1,254 @@
+
+/**
+ * Module dependencies.
+ */
+
+var WS = require('./websocket')
+ , util = require('../util')
+ , debug = require('debug')('engine.io-client:flashsocket');
+
+/**
+ * Module exports.
+ */
+
+module.exports = FlashWS;
+
+/**
+ * Obfuscated key for Blue Coat.
+ */
+
+var xobject = global[['Active'].concat('Object').join('X')];
+
+/**
+ * FlashWS constructor.
+ *
+ * @api public
+ */
+
+function FlashWS (options) {
+ WS.call(this, options);
+ this.flashPath = options.flashPath;
+ this.policyPort = options.policyPort;
+};
+
+/**
+ * Inherits from WebSocket.
+ */
+
+util.inherits(FlashWS, WS);
+
+/**
+ * Transport name.
+ *
+ * @api public
+ */
+
+FlashWS.prototype.name = 'flashsocket';
+
+/**
+ * Opens the transport.
+ *
+ * @api public
+ */
+
+FlashWS.prototype.doOpen = function () {
+ if (!this.check()) {
+ // let the probe timeout
+ return;
+ }
+
+ // instrument websocketjs logging
+ function log (type) {
+ return function(){
+ var str = Array.prototype.join.call(arguments, ' ');
+ debug('[websocketjs %s] %s', type, str);
+ };
+ };
+
+ WEB_SOCKET_LOGGER = { log: log('debug'), error: log('error') };
+ WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true;
+ WEB_SOCKET_DISABLE_AUTO_INITIALIZATION = true;
+
+ if ('undefined' == typeof WEB_SOCKET_SWF_LOCATION) {
+ WEB_SOCKET_SWF_LOCATION = this.flashPath + 'WebSocketMainInsecure.swf';
+ }
+
+ // dependencies
+ var deps = [this.flashPath + 'web_socket.js'];
+
+ if ('undefined' == typeof swfobject) {
+ deps.unshift(this.flashPath + 'swfobject.js');
+ }
+
+ var self = this;
+
+ load(deps, function () {
+ self.ready(function () {
+ WebSocket.__addTask(function () {
+ WS.prototype.doOpen.call(self);
+ });
+ });
+ });
+};
+
+/**
+ * Override to prevent closing uninitialized flashsocket.
+ *
+ * @api private
+ */
+
+FlashWS.prototype.doClose = function () {
+ if (!this.socket) return;
+ var self = this;
+ WebSocket.__addTask(function() {
+ WS.prototype.doClose.call(self);
+ });
+};
+
+/**
+ * Writes to the Flash socket.
+ *
+ * @api private
+ */
+
+FlashWS.prototype.write = function() {
+ var self = this, args = arguments;
+ WebSocket.__addTask(function () {
+ WS.prototype.write.apply(self, args);
+ });
+};
+
+/**
+ * Called upon dependencies are loaded.
+ *
+ * @api private
+ */
+
+FlashWS.prototype.ready = function (fn) {
+ if (typeof WebSocket == 'undefined' ||
+ !('__initialize' in WebSocket) || !swfobject) {
+ return;
+ }
+
+ if (swfobject.getFlashPlayerVersion().major < 10) {
+ return;
+ }
+
+ function init () {
+ // Only start downloading the swf file when the checked that this browser
+ // actually supports it
+ if (!FlashWS.loaded) {
+ if (843 != self.policyPort) {
+ WebSocket.loadFlashPolicyFile('xmlsocket://' + self.host + ':' + self.policyPort);
+ }
+
+ WebSocket.__initialize();
+ FlashWS.loaded = true;
+ }
+
+ fn.call(self);
+ }
+
+ var self = this;
+ if (document.body) {
+ return init();
+ }
+
+ util.load(init);
+};
+
+/**
+ * Feature detection for flashsocket.
+ *
+ * @return {Boolean} whether this transport is available.
+ * @api public
+ */
+
+FlashWS.prototype.check = function () {
+ if ('undefined' != typeof process) {
+ return false;
+ }
+
+ if (typeof WebSocket != 'undefined' && !('__initialize' in WebSocket)) {
+ return false;
+ }
+
+ if (xobject) {
+ var control = null;
+ try {
+ control = new xobject('ShockwaveFlash.ShockwaveFlash');
+ } catch (e) { }
+ if (control) {
+ return true;
+ }
+ } else {
+ for (var i = 0, l = navigator.plugins.length; i < l; i++) {
+ for (var j = 0, m = navigator.plugins[i].length; j < m; j++) {
+ if (navigator.plugins[i][j].description == 'Shockwave Flash') {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+};
+
+/**
+ * Lazy loading of scripts.
+ * Based on $script by Dustin Diaz - MIT
+ */
+
+var scripts = {};
+
+/**
+ * Injects a script. Keeps tracked of injected ones.
+ *
+ * @param {String} path
+ * @param {Function} callback
+ * @api private
+ */
+
+function create (path, fn) {
+ if (scripts[path]) return fn();
+
+ var el = document.createElement('script');
+ var loaded = false;
+
+ debug('loading "%s"', path);
+ el.onload = el.onreadystatechange = function () {
+ if (loaded || scripts[path]) return;
+ var rs = el.readyState;
+ if (!rs || 'loaded' == rs || 'complete' == rs) {
+ debug('loaded "%s"', path);
+ el.onload = el.onreadystatechange = null;
+ loaded = true;
+ scripts[path] = true;
+ fn();
+ }
+ };
+
+ el.async = 1;
+ el.src = path;
+
+ var head = document.getElementsByTagName('head')[0];
+ head.insertBefore(el, head.firstChild);
+};
+
+/**
+ * Loads scripts and fires a callback.
+ *
+ * @param {Array} paths
+ * @param {Function} callback
+ */
+
+function load (arr, fn) {
+ function process (i) {
+ if (!arr[i]) return fn();
+ create(arr[i], function () {
+ process(++i);
+ });
+ };
+
+ process(0);
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js
new file mode 100644
index 0000000..374620b
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js
@@ -0,0 +1,62 @@
+
+/**
+ * Module dependencies
+ */
+
+var XHR = require('./polling-xhr')
+ , JSONP = require('./polling-jsonp')
+ , websocket = require('./websocket')
+ , flashsocket = require('./flashsocket')
+ , util = require('../util');
+
+/**
+ * Export transports.
+ */
+
+exports.polling = polling;
+exports.websocket = websocket;
+exports.flashsocket = flashsocket;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Polling transport polymorphic constructor.
+ * Decides on xhr vs jsonp based on feature detection.
+ *
+ * @api private
+ */
+
+function polling (opts) {
+ var xhr
+ , xd = false
+ , isXProtocol = false;
+
+ if (global.location) {
+ var isSSL = 'https:' == location.protocol;
+ var port = location.port;
+
+ // some user agents have empty `location.port`
+ if (Number(port) != port) {
+ port = isSSL ? 443 : 80;
+ }
+
+ xd = opts.host != location.hostname || port != opts.port;
+ isXProtocol = opts.secure != isSSL;
+ }
+
+ xhr = util.request(xd);
+ /* See #7 at http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx */
+ if (isXProtocol && global.XDomainRequest && xhr instanceof global.XDomainRequest) {
+ return new JSONP(opts);
+ }
+
+ if (xhr && !opts.forceJSONP) {
+ return new XHR(opts);
+ } else {
+ return new JSONP(opts);
+ }
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js
new file mode 100644
index 0000000..fde3e79
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js
@@ -0,0 +1,221 @@
+
+/**
+ * Module requirements.
+ */
+
+var Polling = require('./polling')
+ , util = require('../util');
+
+/**
+ * Module exports.
+ */
+
+module.exports = JSONPPolling;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Cached regular expressions.
+ */
+
+var rNewline = /\n/g;
+
+/**
+ * Global JSONP callbacks.
+ */
+
+var callbacks;
+
+/**
+ * Callbacks count.
+ */
+
+var index = 0;
+
+/**
+ * Noop.
+ */
+
+function empty () { }
+
+/**
+ * JSONP Polling constructor.
+ *
+ * @param {Object} opts.
+ * @api public
+ */
+
+function JSONPPolling (opts) {
+ Polling.call(this, opts);
+
+ // define global callbacks array if not present
+ // we do this here (lazily) to avoid unneeded global pollution
+ if (!callbacks) {
+ // we need to consider multiple engines in the same page
+ if (!global.___eio) global.___eio = [];
+ callbacks = global.___eio;
+ }
+
+ // callback identifier
+ this.index = callbacks.length;
+
+ // add callback to jsonp global
+ var self = this;
+ callbacks.push(function (msg) {
+ self.onData(msg);
+ });
+
+ // append to query string
+ this.query.j = this.index;
+};
+
+/**
+ * Inherits from Polling.
+ */
+
+util.inherits(JSONPPolling, Polling);
+
+/**
+ * Opens the socket.
+ *
+ * @api private
+ */
+
+JSONPPolling.prototype.doOpen = function () {
+ var self = this;
+ util.defer(function () {
+ Polling.prototype.doOpen.call(self);
+ });
+};
+
+/**
+ * Closes the socket
+ *
+ * @api private
+ */
+
+JSONPPolling.prototype.doClose = function () {
+ if (this.script) {
+ this.script.parentNode.removeChild(this.script);
+ this.script = null;
+ }
+
+ if (this.form) {
+ this.form.parentNode.removeChild(this.form);
+ this.form = null;
+ }
+
+ Polling.prototype.doClose.call(this);
+};
+
+/**
+ * Starts a poll cycle.
+ *
+ * @api private
+ */
+
+JSONPPolling.prototype.doPoll = function () {
+ var script = document.createElement('script');
+
+ if (this.script) {
+ this.script.parentNode.removeChild(this.script);
+ this.script = null;
+ }
+
+ script.async = true;
+ script.src = this.uri();
+
+ var insertAt = document.getElementsByTagName('script')[0];
+ insertAt.parentNode.insertBefore(script, insertAt);
+ this.script = script;
+
+ if (util.ua.gecko) {
+ setTimeout(function () {
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ document.body.removeChild(iframe);
+ }, 100);
+ }
+};
+
+/**
+ * Writes with a hidden iframe.
+ *
+ * @param {String} data to send
+ * @param {Function} called upon flush.
+ * @api private
+ */
+
+JSONPPolling.prototype.doWrite = function (data, fn) {
+ var self = this;
+
+ if (!this.form) {
+ var form = document.createElement('form')
+ , area = document.createElement('textarea')
+ , id = this.iframeId = 'eio_iframe_' + this.index
+ , iframe;
+
+ form.className = 'socketio';
+ form.style.position = 'absolute';
+ form.style.top = '-1000px';
+ form.style.left = '-1000px';
+ form.target = id;
+ form.method = 'POST';
+ form.setAttribute('accept-charset', 'utf-8');
+ area.name = 'd';
+ form.appendChild(area);
+ document.body.appendChild(form);
+
+ this.form = form;
+ this.area = area;
+ }
+
+ this.form.action = this.uri();
+
+ function complete () {
+ initIframe();
+ fn();
+ };
+
+ function initIframe () {
+ if (self.iframe) {
+ self.form.removeChild(self.iframe);
+ }
+
+ try {
+ // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
+ iframe = document.createElement('<iframe name="'+ self.iframeId +'">');
+ } catch (e) {
+ iframe = document.createElement('iframe');
+ iframe.name = self.iframeId;
+ }
+
+ iframe.id = self.iframeId;
+
+ self.form.appendChild(iframe);
+ self.iframe = iframe;
+ };
+
+ initIframe();
+
+ // escape \n to prevent it from being converted into \r\n by some UAs
+ this.area.value = data.replace(rNewline, '\\n');
+
+ try {
+ this.form.submit();
+ } catch(e) {}
+
+ if (this.iframe.attachEvent) {
+ this.iframe.onreadystatechange = function(){
+ if (self.iframe.readyState == 'complete') {
+ complete();
+ }
+ };
+ } else {
+ this.iframe.onload = complete;
+ }
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-xhr.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-xhr.js
new file mode 100644
index 0000000..8e74c79
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-xhr.js
@@ -0,0 +1,288 @@
+/**
+ * Module requirements.
+ */
+
+var Polling = require('./polling')
+ , util = require('../util')
+ , Emitter = require('../emitter')
+ , debug = require('debug')('engine.io-client:polling-xhr');
+
+/**
+ * Module exports.
+ */
+
+module.exports = XHR;
+module.exports.Request = Request;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Obfuscated key for Blue Coat.
+ */
+
+var xobject = global[['Active'].concat('Object').join('X')];
+
+/**
+ * Empty function
+ */
+
+function empty(){}
+
+/**
+ * XHR Polling constructor.
+ *
+ * @param {Object} opts
+ * @api public
+ */
+
+function XHR(opts){
+ Polling.call(this, opts);
+
+ if (global.location) {
+ this.xd = opts.host != global.location.hostname ||
+ global.location.port != opts.port;
+ }
+};
+
+/**
+ * Inherits from Polling.
+ */
+
+util.inherits(XHR, Polling);
+
+/**
+ * Opens the socket
+ *
+ * @api private
+ */
+
+XHR.prototype.doOpen = function(){
+ var self = this;
+ util.defer(function(){
+ Polling.prototype.doOpen.call(self);
+ });
+};
+
+/**
+ * Creates a request.
+ *
+ * @param {String} method
+ * @api private
+ */
+
+XHR.prototype.request = function(opts){
+ opts = opts || {};
+ opts.uri = this.uri();
+ opts.xd = this.xd;
+ return new Request(opts);
+};
+
+/**
+ * Sends data.
+ *
+ * @param {String} data to send.
+ * @param {Function} called upon flush.
+ * @api private
+ */
+
+XHR.prototype.doWrite = function(data, fn){
+ var req = this.request({ method: 'POST', data: data });
+ var self = this;
+ req.on('success', fn);
+ req.on('error', function(err){
+ self.onError('xhr post error', err);
+ });
+ this.sendXhr = req;
+};
+
+/**
+ * Starts a poll cycle.
+ *
+ * @api private
+ */
+
+XHR.prototype.doPoll = function(){
+ debug('xhr poll');
+ var req = this.request();
+ var self = this;
+ req.on('data', function(data){
+ self.onData(data);
+ });
+ req.on('error', function(err){
+ self.onError('xhr poll error', err);
+ });
+ this.pollXhr = req;
+};
+
+/**
+ * Request constructor
+ *
+ * @param {Object} options
+ * @api public
+ */
+
+function Request(opts){
+ this.method = opts.method || 'GET';
+ this.uri = opts.uri;
+ this.xd = !!opts.xd;
+ this.async = false !== opts.async;
+ this.data = undefined != opts.data ? opts.data : null;
+ this.create();
+}
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Request.prototype);
+
+/**
+ * Creates the XHR object and sends the request.
+ *
+ * @api private
+ */
+
+Request.prototype.create = function(){
+ var xhr = this.xhr = util.request(this.xd);
+ var self = this;
+
+ xhr.open(this.method, this.uri, this.async);
+
+ if ('POST' == this.method) {
+ try {
+ if (xhr.setRequestHeader) {
+ // xmlhttprequest
+ xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
+ } else {
+ // xdomainrequest
+ xhr.contentType = 'text/plain';
+ }
+ } catch (e) {}
+ }
+
+ if (this.xd && global.XDomainRequest && xhr instanceof XDomainRequest) {
+ xhr.onerror = function(e){
+ self.onError(e);
+ };
+ xhr.onload = function(){
+ self.onData(xhr.responseText);
+ };
+ xhr.onprogress = empty;
+ } else {
+ // ie6 check
+ if ('withCredentials' in xhr) {
+ xhr.withCredentials = true;
+ }
+
+ xhr.onreadystatechange = function(){
+ var data;
+
+ try {
+ if (4 != xhr.readyState) return;
+ if (200 == xhr.status || 1223 == xhr.status) {
+ data = xhr.responseText;
+ } else {
+ self.onError(xhr.status);
+ }
+ } catch (e) {
+ self.onError(e);
+ }
+
+ if (undefined !== data) {
+ self.onData(data);
+ }
+ };
+ }
+
+ debug('sending xhr with url %s | data %s', this.uri, this.data);
+ xhr.send(this.data);
+
+ if (xobject) {
+ this.index = Request.requestsCount++;
+ Request.requests[this.index] = this;
+ }
+};
+
+/**
+ * Called upon successful response.
+ *
+ * @api private
+ */
+
+Request.prototype.onSuccess = function(){
+ this.emit('success');
+ this.cleanup();
+};
+
+/**
+ * Called if we have data.
+ *
+ * @api private
+ */
+
+Request.prototype.onData = function(data){
+ this.emit('data', data);
+ this.onSuccess();
+};
+
+/**
+ * Called upon error.
+ *
+ * @api private
+ */
+
+Request.prototype.onError = function(err){
+ this.emit('error', err);
+ this.cleanup();
+};
+
+/**
+ * Cleans up house.
+ *
+ * @api private
+ */
+
+Request.prototype.cleanup = function(){
+ // xmlhttprequest
+ this.xhr.onreadystatechange = empty;
+
+ // xdomainrequest
+ this.xhr.onload = this.xhr.onerror = empty;
+
+ try {
+ this.xhr.abort();
+ } catch(e) {}
+
+ if (xobject) {
+ delete Request.requests[this.index];
+ }
+
+ this.xhr = null;
+};
+
+/**
+ * Aborts the request.
+ *
+ * @api public
+ */
+
+Request.prototype.abort = function(){
+ this.cleanup();
+};
+
+if (xobject) {
+ Request.requestsCount = 0;
+ Request.requests = {};
+
+ global.attachEvent('onunload', function(){
+ for (var i in Request.requests) {
+ if (Request.requests.hasOwnProperty(i)) {
+ Request.requests[i].abort();
+ }
+ }
+ });
+}
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling.js
new file mode 100644
index 0000000..5550d5f
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling.js
@@ -0,0 +1,210 @@
+/**
+ * Module dependencies.
+ */
+
+var Transport = require('../transport')
+ , util = require('../util')
+ , parser = require('../parser')
+ , debug = require('debug')('engine.io-client:polling');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Polling;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Polling interface.
+ *
+ * @param {Object} opts
+ * @api private
+ */
+
+function Polling(opts){
+ Transport.call(this, opts);
+}
+
+/**
+ * Inherits from Transport.
+ */
+
+util.inherits(Polling, Transport);
+
+/**
+ * Transport name.
+ */
+
+Polling.prototype.name = 'polling';
+
+/**
+ * Opens the socket (triggers polling). We write a PING message to determine
+ * when the transport is open.
+ *
+ * @api private
+ */
+
+Polling.prototype.doOpen = function(){
+ this.poll();
+};
+
+/**
+ * Pauses polling.
+ *
+ * @param {Function} callback upon buffers are flushed and transport is paused
+ * @api private
+ */
+
+Polling.prototype.pause = function(onPause){
+ var pending = 0;
+ var self = this;
+
+ this.readyState = 'pausing';
+
+ function pause(){
+ debug('paused');
+ self.readyState = 'paused';
+ onPause();
+ }
+
+ if (this.polling || !this.writable) {
+ var total = 0;
+
+ if (this.polling) {
+ debug('we are currently polling - waiting to pause');
+ total++;
+ this.once('pollComplete', function(){
+ debug('pre-pause polling complete');
+ --total || pause();
+ });
+ }
+
+ if (!this.writable) {
+ debug('we are currently writing - waiting to pause');
+ total++;
+ this.once('drain', function(){
+ debug('pre-pause writing complete');
+ --total || pause();
+ });
+ }
+ } else {
+ pause();
+ }
+};
+
+/**
+ * Starts polling cycle.
+ *
+ * @api public
+ */
+
+Polling.prototype.poll = function(){
+ debug('polling');
+ this.polling = true;
+ this.doPoll();
+ this.emit('poll');
+};
+
+/**
+ * Overloads onData to detect payloads.
+ *
+ * @api private
+ */
+
+Polling.prototype.onData = function(data){
+ debug('polling got data %s', data);
+ // decode payload
+ var packets = parser.decodePayload(data);
+
+ for (var i = 0, l = packets.length; i < l; i++) {
+ // if its the first message we consider the trnasport open
+ if ('opening' == this.readyState) {
+ this.onOpen();
+ }
+
+ // if its a close packet, we close the ongoing requests
+ if ('close' == packets[i].type) {
+ this.onClose();
+ return;
+ }
+
+ // otherwise bypass onData and handle the message
+ this.onPacket(packets[i]);
+ }
+
+ // if we got data we're not polling
+ this.polling = false;
+ this.emit('pollComplete');
+
+ if ('open' == this.readyState) {
+ this.poll();
+ } else {
+ debug('ignoring poll - transport state "%s"', this.readyState);
+ }
+};
+
+/**
+ * For polling, send a close packet.
+ *
+ * @api private
+ */
+
+Polling.prototype.doClose = function(){
+ debug('sending close packet');
+ this.send([{ type: 'close' }]);
+};
+
+/**
+ * Writes a packets payload.
+ *
+ * @param {Array} data packets
+ * @param {Function} drain callback
+ * @api private
+ */
+
+Polling.prototype.write = function(packets){
+ var self = this;
+ this.writable = false;
+ this.doWrite(parser.encodePayload(packets), function(){
+ self.writable = true;
+ self.emit('drain');
+ });
+};
+
+/**
+ * Generates uri for connection.
+ *
+ * @api private
+ */
+
+Polling.prototype.uri = function(){
+ var query = this.query || {};
+ var schema = this.secure ? 'https' : 'http';
+ var port = '';
+
+ // cache busting is forced for IE / android / iOS6 ಠ_ಠ
+ if (global.ActiveXObject || util.ua.android || util.ua.ios6
+ || this.timestampRequests) {
+ query[this.timestampParam] = +new Date;
+ }
+
+ query = util.qs(query);
+
+ // avoid port if default for schema
+ if (this.port && (('https' == schema && this.port != 443)
+ || ('http' == schema && this.port != 80))) {
+ port = ':' + this.port;
+ }
+
+ // prepend ? to query
+ if (query.length) {
+ query = '?' + query;
+ }
+
+ return schema + '://' + this.host + port + this.path + query;
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/websocket.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/websocket.js
new file mode 100644
index 0000000..1bf055d
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/websocket.js
@@ -0,0 +1,158 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Transport = require('../transport')
+ , parser = require('../parser')
+ , util = require('../util')
+ , debug = require('debug')('engine.io-client:websocket');
+
+/**
+ * Module exports.
+ */
+
+module.exports = WS;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * WebSocket transport constructor.
+ *
+ * @api {Object} connection options
+ * @api public
+ */
+
+function WS(opts){
+ Transport.call(this, opts);
+};
+
+/**
+ * Inherits from Transport.
+ */
+
+util.inherits(WS, Transport);
+
+/**
+ * Transport name.
+ *
+ * @api public
+ */
+
+WS.prototype.name = 'websocket';
+
+/**
+ * Opens socket.
+ *
+ * @api private
+ */
+
+WS.prototype.doOpen = function(){
+ if (!this.check()) {
+ // let probe timeout
+ return;
+ }
+
+ var self = this;
+
+ this.socket = new (ws())(this.uri());
+ this.socket.onopen = function(){
+ self.onOpen();
+ };
+ this.socket.onclose = function(){
+ self.onClose();
+ };
+ this.socket.onmessage = function(ev){
+ self.onData(ev.data);
+ };
+ this.socket.onerror = function(e){
+ self.onError('websocket error', e);
+ };
+};
+
+/**
+ * Writes data to socket.
+ *
+ * @param {Array} array of packets.
+ * @api private
+ */
+
+WS.prototype.write = function(packets){
+ for (var i = 0, l = packets.length; i < l; i++) {
+ this.socket.send(parser.encodePacket(packets[i]));
+ }
+};
+
+/**
+ * Closes socket.
+ *
+ * @api private
+ */
+
+WS.prototype.doClose = function(){
+ if (typeof this.socket !== 'undefined') {
+ this.socket.close();
+ }
+};
+
+/**
+ * Generates uri for connection.
+ *
+ * @api private
+ */
+
+WS.prototype.uri = function(){
+ var query = this.query || {};
+ var schema = this.secure ? 'wss' : 'ws';
+ var port = '';
+
+ // avoid port if default for schema
+ if (this.port && (('wss' == schema && this.port != 443)
+ || ('ws' == schema && this.port != 80))) {
+ port = ':' + this.port;
+ }
+
+ // append timestamp to URI
+ if (this.timestampRequests) {
+ query[this.timestampParam] = +new Date;
+ }
+
+ query = util.qs(query);
+
+ // prepend ? to query
+ if (query.length) {
+ query = '?' + query;
+ }
+
+ return schema + '://' + this.host + port + this.path + query;
+};
+
+/**
+ * Feature detection for WebSocket.
+ *
+ * @return {Boolean} whether this transport is available.
+ * @api public
+ */
+
+WS.prototype.check = function(){
+ var websocket = ws();
+ return !!websocket && !('__initialize' in websocket && this.name === WS.prototype.name);
+};
+
+/**
+ * Getter for WS constructor.
+ *
+ * @api private
+ */
+
+function ws(){
+ if ('undefined' != typeof process) {
+ return require('ws');
+ }
+
+ return global.WebSocket || global.MozWebSocket;
+}
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/util.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/util.js
new file mode 100644
index 0000000..dd9b27c
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/util.js
@@ -0,0 +1,265 @@
+
+/**
+ * Status of page load.
+ */
+
+var pageLoaded = false;
+
+/**
+ * Global reference.
+ */
+
+var global = 'undefined' != typeof window ? window : global;
+
+/**
+ * Inheritance.
+ *
+ * @param {Function} ctor a
+ * @param {Function} ctor b
+ * @api private
+ */
+
+exports.inherits = function inherits (a, b) {
+ function c () { }
+ c.prototype = b.prototype;
+ a.prototype = new c;
+};
+
+/**
+ * Object.keys
+ */
+
+exports.keys = Object.keys || function (obj) {
+ var ret = [];
+ var has = Object.prototype.hasOwnProperty;
+
+ for (var i in obj) {
+ if (has.call(obj, i)) {
+ ret.push(i);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Adds an event.
+ *
+ * @api private
+ */
+
+exports.on = function (element, event, fn, capture) {
+ if (element.attachEvent) {
+ element.attachEvent('on' + event, fn);
+ } else if (element.addEventListener) {
+ element.addEventListener(event, fn, capture);
+ }
+};
+
+/**
+ * Load utility.
+ *
+ * @api private
+ */
+
+exports.load = function (fn) {
+ if (global.document && document.readyState === 'complete' || pageLoaded) {
+ return fn();
+ }
+
+ exports.on(global, 'load', fn, false);
+};
+
+/**
+ * Change the internal pageLoaded value.
+ */
+
+if ('undefined' != typeof window) {
+ exports.load(function () {
+ pageLoaded = true;
+ });
+}
+
+/**
+ * Defers a function to ensure a spinner is not displayed by the browser.
+ *
+ * @param {Function} fn
+ * @api private
+ */
+
+exports.defer = function (fn) {
+ if (!exports.ua.webkit || 'undefined' != typeof importScripts) {
+ return fn();
+ }
+
+ exports.load(function () {
+ setTimeout(fn, 100);
+ });
+};
+
+/**
+ * JSON parse.
+ *
+ * @see Based on jQuery#parseJSON (MIT) and JSON2
+ * @api private
+ */
+
+var rvalidchars = /^[\],:{}\s]*$/
+ , rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g
+ , rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g
+ , rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g
+ , rtrimLeft = /^\s+/
+ , rtrimRight = /\s+$/
+
+exports.parseJSON = function (data) {
+ if ('string' != typeof data || !data) {
+ return null;
+ }
+
+ data = data.replace(rtrimLeft, '').replace(rtrimRight, '');
+
+ // Attempt to parse using the native JSON parser first
+ if (global.JSON && JSON.parse) {
+ return JSON.parse(data);
+ }
+
+ if (rvalidchars.test(data.replace(rvalidescape, '@')
+ .replace(rvalidtokens, ']')
+ .replace(rvalidbraces, ''))) {
+ return (new Function('return ' + data))();
+ }
+};
+
+/**
+ * UA / engines detection namespace.
+ *
+ * @namespace
+ */
+
+exports.ua = {};
+
+/**
+ * Whether the UA supports CORS for XHR.
+ *
+ * @api private
+ */
+
+exports.ua.hasCORS = 'undefined' != typeof XMLHttpRequest && (function () {
+ try {
+ var a = new XMLHttpRequest();
+ } catch (e) {
+ return false;
+ }
+
+ return a.withCredentials != undefined;
+})();
+
+/**
+ * Detect webkit.
+ *
+ * @api private
+ */
+
+exports.ua.webkit = 'undefined' != typeof navigator &&
+ /webkit/i.test(navigator.userAgent);
+
+/**
+ * Detect gecko.
+ *
+ * @api private
+ */
+
+exports.ua.gecko = 'undefined' != typeof navigator &&
+ /gecko/i.test(navigator.userAgent);
+
+/**
+ * Detect android;
+ */
+
+exports.ua.android = 'undefined' != typeof navigator &&
+ /android/i.test(navigator.userAgent);
+
+/**
+ * Detect iOS.
+ */
+
+exports.ua.ios = 'undefined' != typeof navigator &&
+ /^(iPad|iPhone|iPod)$/.test(navigator.platform);
+exports.ua.ios6 = exports.ua.ios && /OS 6_/.test(navigator.userAgent);
+
+/**
+ * XHR request helper.
+ *
+ * @param {Boolean} whether we need xdomain
+ * @api private
+ */
+
+exports.request = function request (xdomain) {
+ if ('undefined' != typeof process) {
+ var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
+ return new XMLHttpRequest();
+ }
+
+ if (xdomain && 'undefined' != typeof XDomainRequest && !exports.ua.hasCORS) {
+ return new XDomainRequest();
+ }
+
+ // XMLHttpRequest can be disabled on IE
+ try {
+ if ('undefined' != typeof XMLHttpRequest && (!xdomain || exports.ua.hasCORS)) {
+ return new XMLHttpRequest();
+ }
+ } catch (e) { }
+
+ if (!xdomain) {
+ try {
+ return new ActiveXObject('Microsoft.XMLHTTP');
+ } catch(e) { }
+ }
+};
+
+/**
+ * Parses an URI
+ *
+ * @author Steven Levithan <stevenlevithan.com> (MIT license)
+ * @api private
+ */
+
+var re = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
+
+var parts = [
+ 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host'
+ , 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
+];
+
+exports.parseUri = function (str) {
+ var m = re.exec(str || '')
+ , uri = {}
+ , i = 14;
+
+ while (i--) {
+ uri[parts[i]] = m[i] || '';
+ }
+
+ return uri;
+};
+
+/**
+ * Compiles a querystring
+ *
+ * @param {Object}
+ * @api private
+ */
+
+exports.qs = function (obj) {
+ var str = '';
+
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ if (str.length) str += '&';
+ str += i + '=' + encodeURIComponent(obj[i]);
+ }
+ }
+
+ return str;
+};
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/component.json
new file mode 100644
index 0000000..82ee9f1
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/component.json
@@ -0,0 +1,12 @@
+{
+ "name": "socket.io-parser",
+ "version": "1.0.1",
+ "description": "socket.io protocol parser",
+ "dependencies": {
+ "component/json": "*"
+ },
+ "scripts": [
+ "index.js"
+ ],
+ "repo": "https://raw.github.com/learnboost/socket.io-protocol"
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/index.js
new file mode 100644
index 0000000..167e8fb
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-socket.io-protocol/index.js
@@ -0,0 +1,177 @@
+
+/**
+ * Module dependencies.
+ */
+
+var json;
+
+try {
+ json = require('json');
+} catch(e){
+ json = JSON;
+}
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+exports.protocol = 1;
+
+/**
+ * Packet types.
+ *
+ * @api public
+ */
+
+exports.types = [
+ 'CONNECT',
+ 'DISCONNECT',
+ 'EVENT',
+ 'ACK',
+ 'ERROR'
+];
+
+/**
+ * Packet type `connect`.
+ *
+ * @api public
+ */
+
+exports.CONNECT = 0;
+
+/**
+ * Packet type `disconnect`.
+ *
+ * @api public
+ */
+
+exports.DISCONNECT = 1;
+
+/**
+ * Packet type `event`.
+ *
+ * @api public
+ */
+
+exports.EVENT = 2;
+
+/**
+ * Packet type `ack`.
+ *
+ * @api public
+ */
+
+exports.ACK = 3;
+
+/**
+ * Packet type `error`.
+ *
+ * @api public
+ */
+
+exports.ERROR = 4;
+
+/**
+ * Encode.
+ *
+ * @param {Object} packet
+ * @return {String} encoded
+ * @api public
+ */
+
+exports.encode = function(obj){
+ var str = '';
+ var nsp = false;
+
+ // first is type
+ str += obj.type;
+
+ // if we have a namespace other than `/`
+ // we append it followed by a comma `,`
+ if (obj.nsp && '/' != obj.nsp) {
+ nsp = true;
+ str += obj.nsp;
+ }
+
+ // immediately followed by the id
+ if (obj.id) {
+ if (nsp) {
+ str += ',';
+ nsp = false;
+ }
+ str += obj.id;
+ }
+
+ // json data
+ if (obj.data) {
+ if (nsp) str += ',';
+ str += json.stringify(obj.data);
+ }
+
+ return str;
+};
+
+/**
+ * Decode.
+ *
+ * @param {String} str
+ * @return {Object} packet
+ * @api public
+ */
+
+exports.decode = function(str){
+ var p = {};
+ var i = 0;
+
+ // look up type
+ p.type = Number(str.charAt(0));
+ if (null == exports.types[p.type]) return error();
+
+ // look up namespace (if any)
+ if ('/' == str.charAt(i + 1)) {
+ p.nsp = '';
+ while (++i) {
+ var c = str.charAt(i);
+ if (',' == c) break;
+ p.nsp += c;
+ if (i + 1 == str.length) break;
+ }
+ } else {
+ p.nsp = '/';
+ }
+
+ // look up id
+ var next = str.charAt(i + 1);
+ if ('' != next && Number(next) == next) {
+ p.id = '';
+ while (++i) {
+ var c = str.charAt(i);
+ if (null == c || Number(c) != c) {
+ --i;
+ break;
+ }
+ p.id += str.charAt(i);
+ if (i + 1 == str.length) break;
+ }
+ }
+
+ // look up json data
+ if (str.charAt(++i)) {
+ try {
+ p.data = json.parse(str.substr(i));
+ } catch(e){
+ return error();
+ }
+ }
+
+ return p;
+};
+
+function error(data){
+ return {
+ type: exports.ERROR,
+ data: 'parser error'
+ };
+}
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/component.json
new file mode 100644
index 0000000..e6a77fe
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/component.json
@@ -0,0 +1,16 @@
+{
+ "name": "to-array",
+ "repo": "timoxley/to-array",
+ "description": "Convert an array-like object into an Array.",
+ "version": "0.1.4",
+ "keywords": [],
+ "dependencies": {},
+ "development": {
+ "timoxley/assert": "*",
+ "component/domify": "*"
+ },
+ "license": "MIT",
+ "scripts": [
+ "index.js"
+ ]
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/index.js
new file mode 100644
index 0000000..cc495d6
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/timoxley-to-array/index.js
@@ -0,0 +1,27 @@
+/**
+ * Convert an array-like object into an `Array`.
+ * If `collection` is already an `Array`, then will return a clone of `collection`.
+ *
+ * @param {Array | Mixed} collection An `Array` or array-like object to convert e.g. `arguments` or `NodeList`
+ * @return {Array} Naive conversion of `collection` to a new `Array`.
+ * @api private
+ */
+
+module.exports = function toArray(collection) {
+ if (typeof collection === 'undefined') return []
+ if (collection === null) return [null]
+ if (collection === window) return [window]
+ if (typeof collection === 'string') return [collection]
+ if (Array.isArray(collection)) return collection.slice()
+ if (typeof collection.length != 'number') return [collection]
+ if (typeof collection === 'function') return [collection]
+
+ var arr = []
+ for (var i = 0; i < collection.length; i++) {
+ if (collection.hasOwnProperty(i) || i in collection) {
+ arr.push(collection[i])
+ }
+ }
+ if (!arr.length) return []
+ return arr
+}
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/component.json b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/component.json
new file mode 100644
index 0000000..2bddc89
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/component.json
@@ -0,0 +1,16 @@
+{
+ "name": "debug",
+ "repo": "visionmedia/debug",
+ "description": "small debugging utility",
+ "version": "0.7.0",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "scripts": [
+ "index.js",
+ "debug.js"
+ ],
+ "dependencies": {}
+} \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/debug.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/debug.js
new file mode 100644
index 0000000..b5fe1bc
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/debug.js
@@ -0,0 +1,122 @@
+
+/**
+ * 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){
+ 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) {
+ localStorage.debug = name;
+
+ 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;
+};
+
+// persist
+
+if (window.localStorage) debug.enable(localStorage.debug); \ No newline at end of file
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/index.js
new file mode 100644
index 0000000..e02c13b
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/visionmedia-debug/index.js
@@ -0,0 +1,5 @@
+if ('undefined' == typeof window) {
+ module.exports = require('./lib/debug');
+} else {
+ module.exports = require('./debug');
+}