Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
openshift: listen on internal IP when no IP is specified
  • Loading branch information
piscisaureus committed Jun 25, 2012
1 parent cd23e6d commit 00cbcfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/dgram.js
Expand Up @@ -56,7 +56,7 @@ function lookup(address, family, callback) {


function lookup4(address, callback) {
return lookup(address || '0.0.0.0', 4, callback);
return lookup(address || process._loopbackAddress(), 4, callback);
}


Expand Down
4 changes: 2 additions & 2 deletions lib/net.js
Expand Up @@ -820,15 +820,15 @@ Server.prototype.listen = function() {
} else if (typeof arguments[1] == 'undefined' ||
typeof arguments[1] == 'function') {
// The first argument is the port, no IP given.
listen(self, '0.0.0.0', port, 4);
listen(self, process._loopbackAddress(), port, 4);

} else {
// The first argument is the port, the second an IP
require('dns').lookup(arguments[1], function(err, ip, addressType) {
if (err) {
self.emit('error', err);
} else {
listen(self, ip || '0.0.0.0', port, ip ? addressType : 4);
listen(self, ip || process._loopbackAddress(), port, ip ? addressType : 4);
}
});
}
Expand Down

0 comments on commit 00cbcfc

Please sign in to comment.