diff options
Diffstat (limited to 'CollectionDaemon.py')
-rw-r--r-- | CollectionDaemon.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CollectionDaemon.py b/CollectionDaemon.py new file mode 100644 index 0000000..a728e75 --- /dev/null +++ b/CollectionDaemon.py @@ -0,0 +1,25 @@ +""" +Implements a daemon that hosts the HTTP server for log collection. + +TODO: + daemonisation + implement both IPv4 and IPv6 modes + proper shutdown +""" + +import CollectionHTTPServer + +class CollectionDaemon: + + def __init__(self, port=8000): + server_class = CollectionHTTPServer.HTTPServer6 + handler_class = CollectionHTTPServer.HTTPRequestHandler + + self.server_address = ('::', port) + self.httpd = server_class(self.server_address, handler_class) + + def start(self): + self.httpd.serve_forever() + +if __name__ == '__main__': + CollectionDaemon().start() |