code: function Link (opts) {
    if(!opts) opts = {}
    this.timeout = opts.timeout || 10*SECONDS
    this.localTransmissionId = 0
    this.lastRemoteTransmissionId = null
    this.credentials = opts.credentials
    this.authenticateFn = opts.authenticate
    this.authorizeReadFn = opts.authorizeRead
    this.authorizeWriteFn = opts.authorizeWrite
    this.authenticated
    this.sentEdit
    this.sentRequestInit
    this.queue
    this.linkBuffer = ''
  
    Duplex.call(this, {allowHalfOpen: false, objectMode: true})
  
    this.on('error', function(er) {
      debug('Error in link', 'undefined'!=typeof window? er : er.stack || er)
    }.bind(this))
  
    this.on('editError', function(er) {
      debug('EditError in link', 'undefined'!=typeof window? er : er.stack || er)
    })
  
    this.reset()
  }
docs: This is a Link
  The public should interact with it via node's streams API (ie. using .pipe etc.)
  Internally, it emits events ("link:*") that are picked up by the Document it is attached to.