camstream/classes/server.py

14 lines
448 B
Python
Raw Permalink Normal View History

2022-02-20 16:21:11 +00:00
from http.server import ThreadingHTTPServer
from classes.handler import ImageHandler
class ImageServer:
def __init__(self, source, fallback, port=8090, ip="0.0.0.0"):
class Handler(ImageHandler):
def __init__(self, *args, **kwargs):
super().__init__(source, fallback, *args, **kwargs)
self.server = ThreadingHTTPServer((ip, port), Handler)
def start(self):
self.server.serve_forever()