baalexander / node-xmlrpc

A pure JavaScript XML-RPC client and server for Node.js.
MIT License
295 stars 150 forks source link

No way to set error handler on http/https server before listen is called #148

Open iwan-aucamp-cs opened 6 years ago

iwan-aucamp-cs commented 6 years ago
  this.httpServer = isSecure ? https.createServer(options, handleMethodCall)
                            : http.createServer(handleMethodCall)

  process.nextTick(function() {
    this.httpServer.listen(options.port, options.host, onListening)
  }.bind(this))
  this.close = function(callback) {
    this.httpServer.once('close', callback)
    this.httpServer.close()
  }.bind(this)
}

This is how the server is created - this gives no opportunity for setting on(error) for http server before listen occurs.