better handling of ipv4 & ipv6

This commit is contained in:
Brandon Nozaki Miller 2015-07-26 22:05:07 -07:00
parent 1326a4c162
commit 7a80005c68

View file

@ -19,12 +19,14 @@ colors.setTheme(
} }
); );
var IPType=os.networkInterfaces()[
Object.keys(os.networkInterfaces())[0]
][0].family
var defaults={ var defaults={
appspace : 'app.', appspace : 'app.',
socketRoot : '/tmp/', socketRoot : '/tmp/',
networkHost : os.networkInterfaces()[ networkHost : (IPType=='IPv6')? '::1' : '127.0.0.1',
Object.keys(os.networkInterfaces())[0]
][0].address,
networkPort : 8000, networkPort : 8000,
id : os.hostname(), id : os.hostname(),
encoding : 'utf8', encoding : 'utf8',
@ -32,7 +34,8 @@ var defaults={
maxConnections : 100, maxConnections : 100,
retry : 500, retry : 500,
maxRetries : false, maxRetries : false,
stopRetrying : false stopRetrying : false,
IPType : IPType
} }
var ipc = { var ipc = {