better handling of ipv4 & ipv6
This commit is contained in:
parent
1326a4c162
commit
7a80005c68
1 changed files with 7 additions and 4 deletions
11
node-ipc.js
11
node-ipc.js
|
@ -19,12 +19,14 @@ colors.setTheme(
|
|||
}
|
||||
);
|
||||
|
||||
var IPType=os.networkInterfaces()[
|
||||
Object.keys(os.networkInterfaces())[0]
|
||||
][0].family
|
||||
|
||||
var defaults={
|
||||
appspace : 'app.',
|
||||
socketRoot : '/tmp/',
|
||||
networkHost : os.networkInterfaces()[
|
||||
Object.keys(os.networkInterfaces())[0]
|
||||
][0].address,
|
||||
networkHost : (IPType=='IPv6')? '::1' : '127.0.0.1',
|
||||
networkPort : 8000,
|
||||
id : os.hostname(),
|
||||
encoding : 'utf8',
|
||||
|
@ -32,7 +34,8 @@ var defaults={
|
|||
maxConnections : 100,
|
||||
retry : 500,
|
||||
maxRetries : false,
|
||||
stopRetrying : false
|
||||
stopRetrying : false,
|
||||
IPType : IPType
|
||||
}
|
||||
|
||||
var ipc = {
|
||||
|
|
Loading…
Reference in a new issue