mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 07:06:26 +01:00
Fix webhook listen (#1383)
The `listen` argument wasn't being passed through to Tornado; this fixes it. Fixes #1382
This commit is contained in:
parent
984bea16d1
commit
2cde878d1e
2 changed files with 4 additions and 3 deletions
|
@ -383,7 +383,7 @@ class Updater(object):
|
|||
ssl_ctx = None
|
||||
|
||||
# Create and start server
|
||||
self.httpd = WebhookServer(port, app, ssl_ctx)
|
||||
self.httpd = WebhookServer(listen, port, app, ssl_ctx)
|
||||
|
||||
if use_ssl:
|
||||
# DO NOT CHANGE: Only set webhook if SSL is handled by library
|
||||
|
|
|
@ -34,8 +34,9 @@ logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|||
|
||||
class WebhookServer(object):
|
||||
|
||||
def __init__(self, port, webhook_app, ssl_ctx):
|
||||
def __init__(self, listen, port, webhook_app, ssl_ctx):
|
||||
self.http_server = HTTPServer(webhook_app, ssl_options=ssl_ctx)
|
||||
self.listen = listen
|
||||
self.port = port
|
||||
self.loop = None
|
||||
self.logger = logging.getLogger(__name__)
|
||||
|
@ -48,7 +49,7 @@ class WebhookServer(object):
|
|||
IOLoop().make_current()
|
||||
self.is_running = True
|
||||
self.logger.debug('Webhook Server started.')
|
||||
self.http_server.listen(self.port)
|
||||
self.http_server.listen(self.port, address=self.listen)
|
||||
self.loop = IOLoop.current()
|
||||
self.loop.start()
|
||||
self.logger.debug('Webhook Server stopped.')
|
||||
|
|
Loading…
Reference in a new issue