diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index 0a34deb..8187c6c 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -155,10 +155,10 @@ class HTTPFactory(http.HTTPFactory): protocol = HTTPProtocol - def __init__(self, server): + def __init__(self, channel_layer, action_logger=None): http.HTTPFactory.__init__(self) - self.channel_layer = server.channel_layer - self.action_logger = server.action_logger + self.channel_layer = channel_layer + self.action_logger = action_logger # We track all sub-protocols for response channel mapping self.reply_protocols = {} # Make a factory for WebSocket protocols diff --git a/daphne/server.py b/daphne/server.py index 076b652..daff148 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -14,7 +14,7 @@ class Server(object): self.action_logger = action_logger def run(self): - self.factory = HTTPFactory(self) + self.factory = HTTPFactory(self.channel_layer, self.action_logger) reactor.listenTCP(self.port, self.factory, interface=self.host) reactor.callInThread(self.backend_reader) reactor.run(installSignalHandlers=self.signal_handlers)