<|start_filename|>node_modules/net-browserify/examples/connect/client.js<|end_filename|>
var net = require('../../browser');

var socket = net.connect({
	host: 'google.com',
	port: 80
});

socket.on('error', function (err) {
	console.error(err);
});

socket.on('connect', function () {
	console.log('Connected!');
});

socket.on('data', function (buffer) {
	document.getElementById('output').innerHTML += buffer.toString();
});

socket.on('end', function () {
	console.log('Socket closed.');
});

var ending = '\r\n';

var reqStr = 'GET /'+ending+'Host: google.com'+ending+ending;
document.getElementById('input').innerHTML = reqStr;

socket.write(reqStr);

<|start_filename|>vendor/consik/yii2-websocket/composer.json<|end_filename|>
{
	"name": "consik/yii2-websocket",
	"description": "Yii2 websocket server component",
	"type": "yii2-extension",
	"keywords": ["yii2", "websocket", "component", "ratchet"],
	"license": "MIT",
	"authors": [
		{
			"name": "<NAME> (Consik)",
			"email": "<EMAIL>"
		}
	],
	"require": {
		"yiisoft/yii2": "*",
		"cboden/ratchet": "0.3.*"
	},
	"autoload": {
		"psr-4": {
			"consik\\yii2websocket\\": ""
		}
	}
}

<|start_filename|>node_modules/net-browserify/examples/connect/server.js<|end_filename|>
var express = require('express');
var netApi = require('../../api');

var app = express();

app.use(netApi());

app.use(express.static(__dirname));

app.listen(3000, function() {
	console.log('Server listening on port 3000');
});

<|start_filename|>node_modules/node-event-emitter/event_emitter.js<|end_filename|>
// Generated by CommonJS Everywhere 0.9.7
(function (global) {
  function require(file, parentModule) {
    if ({}.hasOwnProperty.call(require.cache, file))
      return require.cache[file];
    var resolved = require.resolve(file);
    if (!resolved)
      throw new Error('Failed to resolve module ' + file);
    var module$ = {
        id: file,
        require: require,
        filename: file,
        exports: {},
        loaded: false,
        parent: parentModule,
        children: []
      };
    if (parentModule)
      parentModule.children.push(module$);
    var dirname = file.slice(0, file.lastIndexOf('/') + 1);
    require.cache[file] = module$.exports;
    resolved.call(module$.exports, module$, module$.exports, dirname, file);
    module$.loaded = true;
    return require.cache[file] = module$.exports;
  }
  require.modules = {};
  require.cache = {};
  require.resolve = function (file) {
    return {}.hasOwnProperty.call(require.modules, file) ? require.modules[file] : void 0;
  };
  require.define = function (file, fn) {
    require.modules[file] = fn;
  };
  require.define('/index.js', function (module, exports, __dirname, __filename) {
    var util = {};
    util.isObject = function isObject(arg) {
      return typeof arg === 'object' && arg !== null;
    };
    util.isNumber = function isNumber(arg) {
      return typeof arg === 'number';
    };
    util.isUndefined = function isUndefined(arg) {
      return arg === void 0;
    };
    util.isFunction = function isFunction(arg) {
      return typeof arg === 'function';
    };
    function EventEmitter() {
      EventEmitter.init.call(this);
    }
    module.exports = EventEmitter;
    EventEmitter.EventEmitter = EventEmitter;
    EventEmitter.prototype._events = undefined;
    EventEmitter.prototype._maxListeners = undefined;
    EventEmitter.defaultMaxListeners = 10;
    EventEmitter.init = function () {
      this._events = this._events || {};
      this._maxListeners = this._maxListeners || undefined;
    };
    EventEmitter.prototype.setMaxListeners = function (n) {
      if (!util.isNumber(n) || n < 0 || isNaN(n))
        throw TypeError('n must be a positive number');
      this._maxListeners = n;
      return this;
    };
    EventEmitter.prototype.emit = function (type) {
      var er, handler, len, args, i, listeners;
      if (!this._events)
        this._events = {};
      if (type === 'error' && !this._events.error) {
        er = arguments[1];
        if (er instanceof Error) {
          throw er;
        } else {
          throw Error('Uncaught, unspecified "error" event.');
        }
        return false;
      }
      handler = this._events[type];
      if (util.isUndefined(handler))
        return false;
      if (util.isFunction(handler)) {
        switch (arguments.length) {
        case 1:
          handler.call(this);
          break;
        case 2:
          handler.call(this, arguments[1]);
          break;
        case 3:
          handler.call(this, arguments[1], arguments[2]);
          break;
        default:
          len = arguments.length;
          args = new Array(len - 1);
          for (i = 1; i < len; i++)
            args[i - 1] = arguments[i];
          handler.apply(this, args);
        }
      } else if (util.isObject(handler)) {
        len = arguments.length;
        args = new Array(len - 1);
        for (i = 1; i < len; i++)
          args[i - 1] = arguments[i];
        listeners = handler.slice();
        len = listeners.length;
        for (i = 0; i < len; i++)
          listeners[i].apply(this, args);
      }
      return true;
    };
    EventEmitter.prototype.addListener = function (type, listener) {
      var m;
      if (!util.isFunction(listener))
        throw TypeError('listener must be a function');
      if (!this._events)
        this._events = {};
      if (this._events.newListener)
        this.emit('newListener', type, util.isFunction(listener.listener) ? listener.listener : listener);
      if (!this._events[type])
        this._events[type] = listener;
      else if (util.isObject(this._events[type]))
        this._events[type].push(listener);
      else
        this._events[type] = [
          this._events[type],
          listener
        ];
      if (util.isObject(this._events[type]) && !this._events[type].warned) {
        var m;
        if (!util.isUndefined(this._maxListeners)) {
          m = this._maxListeners;
        } else {
          m = EventEmitter.defaultMaxListeners;
        }
        if (m && m > 0 && this._events[type].length > m) {
          this._events[type].warned = true;
          if (util.isFunction(console.error)) {
            console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);
          }
          if (util.isFunction(console.trace))
            console.trace();
        }
      }
      return this;
    };
    EventEmitter.prototype.on = EventEmitter.prototype.addListener;
    EventEmitter.prototype.once = function (type, listener) {
      if (!util.isFunction(listener))
        throw TypeError('listener must be a function');
      var fired = false;
      function g() {
        this.removeListener(type, g);
        if (!fired) {
          fired = true;
          listener.apply(this, arguments);
        }
      }
      g.listener = listener;
      this.on(type, g);
      return this;
    };
    EventEmitter.prototype.removeListener = function (type, listener) {
      var list, position, length, i;
      if (!util.isFunction(listener))
        throw TypeError('listener must be a function');
      if (!this._events || !this._events[type])
        return this;
      list = this._events[type];
      length = list.length;
      position = -1;
      if (list === listener || util.isFunction(list.listener) && list.listener === listener) {
        delete this._events[type];
        if (this._events.removeListener)
          this.emit('removeListener', type, listener);
      } else if (util.isObject(list)) {
        for (i = length; i-- > 0;) {
          if (list[i] === listener || list[i].listener && list[i].listener === listener) {
            position = i;
            break;
          }
        }
        if (position < 0)
          return this;
        if (list.length === 1) {
          list.length = 0;
          delete this._events[type];
        } else {
          list.splice(position, 1);
        }
        if (this._events.removeListener)
          this.emit('removeListener', type, listener);
      }
      return this;
    };
    EventEmitter.prototype.removeAllListeners = function (type) {
      var key, listeners;
      if (!this._events)
        return this;
      if (!this._events.removeListener) {
        if (arguments.length === 0)
          this._events = {};
        else if (this._events[type])
          delete this._events[type];
        return this;
      }
      if (arguments.length === 0) {
        for (key in this._events) {
          if (key === 'removeListener')
            continue;
          this.removeAllListeners(key);
        }
        this.removeAllListeners('removeListener');
        this._events = {};
        return this;
      }
      listeners = this._events[type];
      if (util.isFunction(listeners)) {
        this.removeListener(type, listeners);
      } else if (Array.isArray(listeners)) {
        while (listeners.length)
          this.removeListener(type, listeners[listeners.length - 1]);
      }
      delete this._events[type];
      return this;
    };
    EventEmitter.prototype.listeners = function (type) {
      var ret;
      if (!this._events || !this._events[type])
        ret = [];
      else if (util.isFunction(this._events[type]))
        ret = [this._events[type]];
      else
        ret = this._events[type].slice();
      return ret;
    };
    EventEmitter.listenerCount = function (emitter, type) {
      var ret;
      if (!emitter._events || !emitter._events[type])
        ret = 0;
      else if (util.isFunction(emitter._events[type]))
        ret = 1;
      else
        ret = emitter._events[type].length;
      return ret;
    };
  });
  global.EventEmitter = require('/index.js');
}.call(this, this));

<|start_filename|>node_modules/net-browserify/examples/connect/Makefile<|end_filename|>
all: bundle

bundle:
	browserify client.js > bundle.js


<|start_filename|>node_modules/node-event-emitter/Makefile<|end_filename|>
default: test

BIN = node_modules/.bin
CJSIFY = $(BIN)/cjsify --no-node
MOCHA = $(BIN)/mocha

.PHONY: test

all: test bundle

test:
	@$(MOCHA) --reporter spec --recursive --colors

bundle:	browserify browserify-min

browserify:
	$(CJSIFY) --export EventEmitter index.js -o event_emitter.js

browserify-min:
	$(CJSIFY) --minify --export EventEmitter index.js -o event_emitter.min.js


<|start_filename|>node_modules/node-event-emitter/test/index_test.js<|end_filename|>
var expect = require('chai').expect
  , EventEmitter = require('../').EventEmitter
  , sinon = require('sinon');

describe('EventEmitter', function(){
  describe('#on', function(){
    it('is aliased as addListener', function(){
      expect(EventEmitter.prototype.on).to.equal(EventEmitter.prototype.addListener);
    });

    it('adds a handler for a specified event', function(){
      var emitter = new EventEmitter
        , fn = function(){};

      emitter.on('some:event', fn);

      expect(!!~emitter.listeners('some:event').indexOf(fn)).to.be.true;
      expect(!!~emitter.listeners('another:event').indexOf(fn)).to.be.false;
      expect(EventEmitter.listenerCount(emitter, 'some:event')).to.equal(1);
    });
  });

  describe('#emit', function(){
    it('invokes all handlers for a given event', function(){
      var emitter = new EventEmitter
        , spy1 = sinon.spy()
        , spy2 = sinon.spy()
        , spy3 = sinon.spy();

      emitter.on('some:event', spy1);
      emitter.on('some:event', spy2);
      emitter.on('another:event', spy3);

      emitter.emit('some:event');

      expect(spy1.callCount).to.equal(1);
      expect(spy2.callCount).to.equal(1);
      expect(spy3.callCount).to.equal(0);
    });
  });

  describe('#removeListener', function(){
    it('removes a given handler for a given event', function(){
      var emitter = new EventEmitter
        , spy1 = sinon.spy()
        , spy2 = sinon.spy();

      emitter.on('some:event', spy1);
      emitter.on('some:event', spy2);

      emitter.removeListener('some:event', spy1);
      emitter.emit('some:event');

      expect(spy1.callCount).to.equal(0);
      expect(spy2.callCount).to.equal(1);
    });
  });


  describe('#removeAllListeners', function(){
    it('removes all listeners for a given event', function(){
      var emitter = new EventEmitter
        , spy1 = sinon.spy()
        , spy2 = sinon.spy()
        , spy3 = sinon.spy();

      emitter.on('some:event', spy1);
      emitter.on('some:event', spy2);
      emitter.on('another:event', spy3);

      emitter.removeAllListeners('some:event');
      emitter.emit('some:event');
      emitter.emit('another:event');

      expect(spy1.callCount).to.equal(0);
      expect(spy2.callCount).to.equal(0);
      expect(spy3.callCount).to.equal(1);
    });

    it('removes all listeners bound to the emitter', function(){
      var emitter = new EventEmitter
        , spy1 = sinon.spy()
        , spy2 = sinon.spy()
        , spy3 = sinon.spy();

      emitter.on('some:event', spy1);
      emitter.on('some:event', spy2);
      emitter.on('another:event', spy3);

      emitter.removeAllListeners();
      emitter.emit('some:event');
      emitter.emit('another:event');

      expect(spy1.callCount).to.equal(0);
      expect(spy2.callCount).to.equal(0);
      expect(spy3.callCount).to.equal(0);
    });
  });
});
