From 10ad6b46f53e316395975e3b9a164d52c02ed922 Mon Sep 17 00:00:00 2001 From: Marcelo Casiraghi Date: Sun, 30 Mar 2014 19:39:30 -0300 Subject: [PATCH] Add support for configurable server ip address --- lib/server.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index 639d318..73cf3e1 100644 --- a/lib/server.js +++ b/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. */