summaryrefslogtreecommitdiffstats
path: root/module/remote/WebSocketBackend.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-22 16:21:17 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-22 16:21:17 +0200
commit2bbdd6cf3a0ea429583a9e4b840e68c238e08a46 (patch)
tree3adf00866aa7fe5ac59bd5430754ad9dfcbc72b8 /module/remote/WebSocketBackend.py
parentadded websocket backend, removed thrift (diff)
downloadpyload-2bbdd6cf3a0ea429583a9e4b840e68c238e08a46.tar.xz
web socket api handler
Diffstat (limited to 'module/remote/WebSocketBackend.py')
-rw-r--r--module/remote/WebSocketBackend.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/module/remote/WebSocketBackend.py b/module/remote/WebSocketBackend.py
index 7af927d8f..6e01dad87 100644
--- a/module/remote/WebSocketBackend.py
+++ b/module/remote/WebSocketBackend.py
@@ -21,7 +21,7 @@ import logging
from module.remote.RemoteManager import BackendBase
from mod_pywebsocket import util
-def get_class_logger(o):
+def get_class_logger(o=None):
return logging.getLogger('log')
# Monkey patch for our logger
@@ -30,15 +30,17 @@ util.get_class_logger = get_class_logger
class WebSocketBackend(BackendBase):
def setup(self, host, port):
-
from wsbackend.Server import WebSocketServer, DefaultOptions
- from wsbackend.Dispatcher import Dispatcher, ApiHandler
+ from wsbackend.Dispatcher import Dispatcher
+ from wsbackend.ApiHandler import ApiHandler
+ from wsbackend.EventHandler import EventHandler
options = DefaultOptions()
options.server_host = host
options.port = port
options.dispatcher = Dispatcher()
- options.dispatcher.addHandler('/api', ApiHandler())
+ options.dispatcher.addHandler('/api', ApiHandler(self.core.api))
+ options.dispatcher.addHandler('/events', EventHandler(self.core.api))
self.server = WebSocketServer(options)