Permalink
Browse files

default to listening on 0.0.0.0 just like node

  • Loading branch information...
1 parent 7f52f94 commit 9ed1c708236b37877aaf7f0457498387ca724a26 @substack committed Nov 6, 2011
Showing with 13 additions and 6 deletions.
  1. +12 −5 index.js
  2. +1 −1 package.json
View
@@ -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,
@@ -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();
View
@@ -1,6 +1,6 @@
{
"name" : "dnode",
- "version" : "0.9.1",
+ "version" : "0.9.2",
"description" : "freestyle RPC",
"main" : "./index.js",
"keywords" : [

0 comments on commit 9ed1c70

Please sign in to comment.