From 4ac15ab8421c2c92322e715ffd1550203b212a21 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Sat, 6 Jan 2018 13:18:18 +0200 Subject: Add configuration value to specify the binding address of the HTTP server Implements #24 --- plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugin.py') diff --git a/plugin.py b/plugin.py index cbcd7d5..166e353 100644 --- a/plugin.py +++ b/plugin.py @@ -58,6 +58,7 @@ class Github(callbacks.Plugin): This should describe how to use this plugin.""" threaded = True + address = Utility.configValue('address') port = Utility.configValue('port') messages = [] pass @@ -69,7 +70,7 @@ class Github(callbacks.Plugin): def ServerStart(self, httpd): try: - log.info('Server Starts - %s:%s' % ('', self.port)) + log.info('Server Starts - %s:%s' % (self.address, self.port)) httpd.serve_forever() except: return @@ -79,7 +80,7 @@ class Github(callbacks.Plugin): self.__parent = super(Github, self) self.__parent.__init__(irc) server_class = BaseHTTPServer.HTTPServer - self.httpd = server_class(('', self.port), RequestHandler.GithubHandler) + self.httpd = server_class((self.address, self.port), RequestHandler.GithubHandler) t = threading.Thread(target=self.ServerStart, args=(self.httpd,)) t.daemon = False t.start() -- cgit v1.2.3