index.js
function Client (opts) {
  var self = this

  typeforce({
    url: 'String',
    otrKey: 'DSA',
    // byRootHash: 'Function',
    instanceTag: '?String',
    autoconnect: '?Boolean' // defaults to true
  }, opts)

  EventEmitter.call(this)
  this.setMaxListeners(0)

  this._url = parseURL(opts.url)
  this._autoconnect = opts.autoconnect !== false
  this._onmessage = this._onmessage.bind(this)
  this._sessions = {}
  this._otrKey = opts.otrKey
  this._fingerprint = opts.otrKey.fingerprint()
  this._connected = false
  this._instanceTag = opts.instanceTag
  this._backoff = backoff.exponential({ initialDelay: 100 })
  if (this._autoconnect) this.connect()
}
function Client (opts) {
  var self = this

  typeforce({
    url: 'String',
    otrKey: 'DSA',
    // byRootHash: 'Function',
    instanceTag: '?String',
    autoconnect: '?Boolean' // defaults to true
  }, opts)

  EventEmitter.call(this)
  this.setMaxListeners(0)

  this._url = parseURL(opts.url)
  this._autoconnect = opts.autoconnect !== false
  this._onmessage = this._onmessage.bind(this)
  this._sessions = {}
  this._otrKey = opts.otrKey
  this._fingerprint = opts.otrKey.fingerprint()
  this._connected = false
  this._instanceTag = opts.instanceTag
  this._backoff = backoff.exponential({ initialDelay: 100 })
  if (this._autoconnect) this.connect()
}
function Client ( opts ) { var self = this typeforce ( { url : 'String' , otrKey : 'DSA' , // byRootHash: 'Function', instanceTag : '?String' , autoconnect : '?Boolean' // defaults to true } , opts ) EventEmitter . call ( this ) this . setMaxListeners ( 0 ) this . _url = parseURL ( opts . url ) this . _autoconnect = opts . autoconnect !== false this . _onmessage = this . _onmessage . bind ( this ) this . _sessions = { } this . _otrKey = opts . otrKey this . _fingerprint = opts . otrKey . fingerprint ( ) this . _connected = false this . _instanceTag = opts . instanceTag this . _backoff = backoff . exponential ( { initialDelay : 100 } ) if ( this . _autoconnect ) this . connect ( ) }
var HANDSHAKE_TIMEOUT = 5000
var HANDSHAKE_TIMEOUT = 5000