2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 13:27:44 +00:00

Specific port on webHook server

This commit is contained in:
yago 2015-06-30 00:02:42 +02:00
parent 2598b1dce9
commit f1f25d84a6

View File

@ -44,13 +44,14 @@ var TelegramBot = function (token, options) {
var port = options.webHook.port || 8443; var port = options.webHook.port || 8443;
var key = options.webHook.key; var key = options.webHook.key;
var cert = options.webHook.cert; 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); util.inherits(TelegramBot, EventEmitter);
TelegramBot.prototype._configureWebHook = function (port, key, cert) { TelegramBot.prototype._configureWebHook = function (port, host, key, cert) {
var protocol = 'HTTP'; var protocol = 'HTTP';
var self = this; 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); console.log(protocol+" WebHook listening on:", port);
}); });
}; };