From f1f25d84a60913385d3852ccefa50a0398f96949 Mon Sep 17 00:00:00 2001 From: yago Date: Tue, 30 Jun 2015 00:02:42 +0200 Subject: [PATCH] Specific port on webHook server --- src/telegram.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/telegram.js b/src/telegram.js index e531e5f..942a508 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -44,13 +44,14 @@ var TelegramBot = function (token, options) { var port = options.webHook.port || 8443; var key = options.webHook.key; var cert = options.webHook.cert; - this._configureWebHook(port, key, cert); + var host = options.webHook.host; + this._configureWebHook(port, host, key, cert); } }; util.inherits(TelegramBot, EventEmitter); -TelegramBot.prototype._configureWebHook = function (port, key, cert) { +TelegramBot.prototype._configureWebHook = function (port, host, key, cert) { var protocol = 'HTTP'; var self = this; @@ -69,7 +70,7 @@ TelegramBot.prototype._configureWebHook = function (port, key, cert) { }); } - this._webServer.listen(port, function () { + this._webServer.listen(port, host, function () { console.log(protocol+" WebHook listening on:", port); }); };