lib/S2S/Router.js
/**
 * Accepts incoming S2S connections. Handles routing of outgoing
 * stanzas, and allows you to register a handler
 * for your own domain.
 */
Accepts incoming S2S connections. Handles routing of outgoing
stanzas, and allows you to register a handler
for your own domain.
Accepts incoming S2S connections . Handles routing of outgoing stanzas and allows you to register a handler for your own domain .
function Router (s2sPort, bindAddress, opts) {
  EventEmitter.call(this)
  this.ctxs = {}
  opts = opts || {}
  this.generateId = rack(opts.idBits, opts.idBitsBase, opts.idBitsExpandBy)
  if (opts.secureDomains && opts.secureDomains.length) {
    opts.secureDomains.forEach(this.addSecureDomain, this)
  }
  net.createServer(function (socket) {
    this.acceptConnection(socket)
  }.bind(this)).listen(s2sPort || 5269, bindAddress || '::')
}
function Router ( s2sPort , bindAddress , opts ) { EventEmitter . call ( this ) this . ctxs = { } opts = opts || { } this . generateId = rack ( opts . idBits , opts . idBitsBase , opts . idBitsExpandBy ) if ( opts . secureDomains && opts . secureDomains . length ) { opts . secureDomains . forEach ( this . addSecureDomain , this ) } net . createServer ( function ( socket ) { this . acceptConnection ( socket ) } . bind ( this ) ) . listen ( s2sPort || 5269 , bindAddress || '::' ) }
Accepts incoming S2S connections.
Accepts incoming S2S connections .
// start tcp socket