From 3eb0228c9158ef14ca0210732f24db29bf6c0725 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 3 May 2015 20:29:58 -0700 Subject: [PATCH] allow specifying hostnames for udp/http individually --- server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index e3829ae..57704f1 100644 --- a/server.js +++ b/server.js @@ -121,9 +121,9 @@ Server.prototype.listen = function (/* port, hostname, onlistening */) { // ATTENTION: // binding to :: only receives IPv4 connections if the bindv6only // sysctl is set 0, which is the default on many operating systems. - if (self.http) self.http.listen(port.http || port, hostname || '::') - if (self.udp4) self.udp4.bind(port.udp || port, hostname) - if (self.udp6) self.udp6.bind(port.udp || port, hostname) + if (self.http) self.http.listen(port.http || port, (hostname && hostname.http) || hostname || '::') + if (self.udp4) self.udp4.bind(port.udp || port, (hostname && hostname.udp) || hostname) + if (self.udp6) self.udp6.bind(port.udp || port, (hostname && hostname.udp) || hostname) } Server.prototype.close = function (cb) {