Skip to content

Commit

Permalink
default to listening on 0.0.0.0 just like node
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Nov 6, 2011
1 parent 7f52f94 commit 9ed1c70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions index.js
Expand Up @@ -132,7 +132,6 @@ dnode.prototype.listen = function () {
var server = params.server;

if (params.port) {
params.host = params.host || '127.0.0.1';
if (params.key) {
var options = {
key: params.key,
Expand All @@ -143,10 +142,18 @@ dnode.prototype.listen = function () {
};
server = tls.createServer(options);
server.on('error', this.emit.bind(this, 'error'));
server.listen(
params.port, params.host,
this.emit.bind(this, 'ready')
);
if (params.host) {
server.listen(
params.port, params.host,
this.emit.bind(this, 'ready')
);
}
else {
server.listen(
params.port,
this.emit.bind(this, 'ready')
);
}
}
else {
server = net.createServer();
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name" : "dnode",
"version" : "0.9.1",
"version" : "0.9.2",
"description" : "freestyle RPC",
"main" : "./index.js",
"keywords" : [
Expand Down

0 comments on commit 9ed1c70

Please sign in to comment.