diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -24,6 +24,7 @@ from lib.cycloneerr import PrettyErrorHa class EffectEdit(PrettyErrorHandler, cyclone.web.RequestHandler): def get(self): + self.set_header('Content-Type', 'text/html') self.write(open("light9/effecteval/effect.html").read()) def delete(self): graph = self.settings.graph diff --git a/bin/homepageConfig b/bin/homepageConfig --- a/bin/homepageConfig +++ b/bin/homepageConfig @@ -18,7 +18,18 @@ def printConfig(result): continue path = current.value(role, L9['urlPath']) server = server.rstrip('/') - print "location /%(path)s { proxy_pass %(server)s; rewrite /[^/]+/(.*) /$1 break; }" % vars() + print """ + location /%(path)s { + + # for websocket + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + + proxy_pass %(server)s; + rewrite /[^/]+/(.*) /$1 break; + }""" % vars() reactor.stop() diff --git a/bin/subserver b/bin/subserver --- a/bin/subserver +++ b/bin/subserver @@ -115,7 +115,7 @@ if __name__ == "__main__": log.setLevel(logging.DEBUG if options.verbose else logging.INFO) - graph = SyncedGraph(networking.rdfdb.url, "subserver") + graph = SyncedGraph(networking.rdfdb.url, "subServer") d = {} def updateSubs(): @@ -146,7 +146,7 @@ if __name__ == "__main__": graph.addHandler(updateSubs) - port = 8052 + port = networking.subServer.port reactor.listenTCP(port, cyclone.web.Application(handlers=[ (r'/live', Live), (r'/effectsUpdates', EffectsUpdates), diff --git a/light9/effecteval/effect.coffee b/light9/effecteval/effect.coffee --- a/light9/effecteval/effect.coffee +++ b/light9/effecteval/effect.coffee @@ -4,7 +4,7 @@ model = uri: ko.observable(qs.value('uri')) codeLines: ko.observableArray([]) -socket = reconnectingWebSocket "ws://localhost:8070/effectUpdates" + window.location.search, (msg) -> +socket = reconnectingWebSocket "../effectUpdates" + window.location.search, (msg) -> console.log('effectData ' + JSON.stringify(msg)) model.toSave.codeLines(msg.codeLines.map((x) -> {text: ko.observable(x)})) if msg.codeLines? diff --git a/light9/effecteval/effect.html b/light9/effecteval/effect.html --- a/light9/effecteval/effect.html +++ b/light9/effecteval/effect.html @@ -7,6 +7,8 @@ +
starting...
+ Effects /
diff --git a/light9/effecteval/index.coffee b/light9/effecteval/index.coffee --- a/light9/effecteval/index.coffee +++ b/light9/effecteval/index.coffee @@ -21,7 +21,7 @@ deleteEffect = (uri) -> url: 'effect?' + $.param({uri: uri}) console.log("del", uri) -reconnectingWebSocket "ws://localhost:8070/songEffectsUpdates", (msg) -> +reconnectingWebSocket "songEffectsUpdates", (msg) -> for s in msg.songs for e in s.effects do (e) -> diff --git a/light9/effecteval/index.html b/light9/effecteval/index.html --- a/light9/effecteval/index.html +++ b/light9/effecteval/index.html @@ -6,6 +6,7 @@ +
starting...
/stats

Effect instances

View all songs
diff --git a/light9/networking.py b/light9/networking.py --- a/light9/networking.py +++ b/light9/networking.py @@ -35,15 +35,16 @@ class ServiceAddress(object): def path(self, more): return self.url + str(more) +curveCalc = ServiceAddress(L9['curveCalc']) dmxServer = ServiceAddress(L9['dmxServer']) -oscDmxServer = ServiceAddress(L9['oscDmxServer']) -musicPlayer = ServiceAddress(L9['musicPlayer']) +effectEval = ServiceAddress(L9['effectEval']) keyboardComposer = ServiceAddress(L9['keyboardComposer']) -curveCalc = ServiceAddress(L9['curveCalc']) -vidref = ServiceAddress(L9['vidref']) -effectEval = ServiceAddress(L9['effectEval']) +musicPlayer = ServiceAddress(L9['musicPlayer']) +oscDmxServer = ServiceAddress(L9['oscDmxServer']) picamserve = ServiceAddress(L9['picamserve']) rdfdb = ServiceAddress(L9['rdfdb']) subComposer = ServiceAddress(L9['subComposer']) +subServer = ServiceAddress(L9['subServer']) +vidref = ServiceAddress(L9['vidref']) patchReceiverUpdateHost = ServiceAddress(L9['patchReceiverUpdateHost']) diff --git a/light9/rdfdb/web/graphView.xhtml b/light9/rdfdb/web/graphView.xhtml --- a/light9/rdfdb/web/graphView.xhtml +++ b/light9/rdfdb/web/graphView.xhtml @@ -13,8 +13,8 @@ graph all the time --> -

status: starting...

- +
starting...
+
Messages
diff --git a/light9/rdfdb/web/index.xhtml b/light9/rdfdb/web/index.xhtml --- a/light9/rdfdb/web/index.xhtml +++ b/light9/rdfdb/web/index.xhtml @@ -8,7 +8,7 @@

rdfdb

-

status: starting...

+
starting...

Edits

@@ -52,7 +52,7 @@ $('#out').append($('
').text(JSON.stringify(d))); } - reconnectingWebSocket("ws://localhost:8051/live", onMessage); + reconnectingWebSocket("live", onMessage); }); // ]]> diff --git a/light9/rdfdb/web/syncedgraph.js b/light9/rdfdb/web/syncedgraph.js --- a/light9/rdfdb/web/syncedgraph.js +++ b/light9/rdfdb/web/syncedgraph.js @@ -23,5 +23,5 @@ function SyncedGraph(label) { $('#out').append($('
').text(JSON.stringify(d))); } - reconnectingWebSocket("ws://localhost:8051/liveSyncedGraph", onMessage); + reconnectingWebSocket("liveSyncedGraph", onMessage); } diff --git a/light9/subcomposer/index.html b/light9/subcomposer/index.html --- a/light9/subcomposer/index.html +++ b/light9/subcomposer/index.html @@ -44,7 +44,7 @@ - +