Browse Source

Add support for configurable server ip address

Marcelo Casiraghi 11 years ago
parent
commit
10ad6b46f5
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lib/server.js

+ 7 - 2
lib/server.js

@@ -281,8 +281,13 @@ PeerServer.prototype._initializeHTTP = function() {
 
   this._app.post(this._options.path + ':key/:id/:token/leave', handle);
 
-  // Listen on user-specified port.
-  this._app.listen(this._options.port);
+  //Listen on user-specified port and ip address.
+  if (this._options.ip) {
+    this._app.listen(this._options.port, this._options.ip);
+  } else {
+    this._app.listen(this._options.port);
+  }
+
 };
 
 /** Saves a streaming response and takes care of timeouts and headers. */