lib/connection.js
function Connection(options) {
  if (!(this instanceof Connection)) {
    return new Connection(options);
  }

  events.EventEmitter.call(this);

  this.options = merge(Object.create(Connection.DEFAULTS), options);

  this._log = new kademlia.Logger(this.options.logLevel);
  this._natClient = nat.createClient();
}
function Connection(options) {
  if (!(this instanceof Connection)) {
    return new Connection(options);
  }

  events.EventEmitter.call(this);

  this.options = merge(Object.create(Connection.DEFAULTS), options);

  this._log = new kademlia.Logger(this.options.logLevel);
  this._natClient = nat.createClient();
}
function Connection ( options ) { if ( ! ( this instanceof Connection ) ) { return new Connection ( options ) ; } events . EventEmitter . call ( this ) ; this . options = merge ( Object . create ( Connection . DEFAULTS ) , options ) ; this . _log = new kademlia . Logger ( this . options . logLevel ) ; this . _natClient = nat . createClient ( ) ; }
Creates a connection the the Muttr DHT
@constructor
@param {object}   options
@param {string}   options.address
@param {number}   options.port
@param {array}    options.seeds
@param {object}   options.seeds[]
@param {string}   options.seeds[].address
@param {number}   options.seeds[].port
@param {object}   options.storage
@param {function} options.storage.get
@param {function} options.storage.put
@param {function} options.storage.del
@param {function} options.storage.createReadStream
@param {boolean}  options.forwardPort
@param {boolean}  options.logLevel
Creates a connection the the Muttr DHT