# HG changeset patch # User Drew Perttula # Date 1433729305 0 # Node ID e703b3434dbd48c49597b64b5b0c646cb2115d95 # Parent 896979e6f352d389b906b2e394b66a6c114721b2 websocket and web cleanup Ignore-this: ac6bd0444bc03ee79ce71c4aa7740bc0 diff -r 896979e6f352 -r e703b3434dbd bin/effecteval --- a/bin/effecteval Mon Jun 08 00:38:49 2015 +0000 +++ b/bin/effecteval Mon Jun 08 02:08:25 2015 +0000 @@ -24,6 +24,7 @@ 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 -r 896979e6f352 -r e703b3434dbd bin/homepageConfig --- a/bin/homepageConfig Mon Jun 08 00:38:49 2015 +0000 +++ b/bin/homepageConfig Mon Jun 08 02:08:25 2015 +0000 @@ -18,7 +18,18 @@ 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 -r 896979e6f352 -r e703b3434dbd bin/subserver --- a/bin/subserver Mon Jun 08 00:38:49 2015 +0000 +++ b/bin/subserver Mon Jun 08 02:08:25 2015 +0000 @@ -115,7 +115,7 @@ 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 @@ graph.addHandler(updateSubs) - port = 8052 + port = networking.subServer.port reactor.listenTCP(port, cyclone.web.Application(handlers=[ (r'/live', Live), (r'/effectsUpdates', EffectsUpdates), diff -r 896979e6f352 -r e703b3434dbd light9/effecteval/effect.coffee --- a/light9/effecteval/effect.coffee Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/effecteval/effect.coffee Mon Jun 08 02:08:25 2015 +0000 @@ -4,7 +4,7 @@ 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 -r 896979e6f352 -r e703b3434dbd light9/effecteval/effect.html --- a/light9/effecteval/effect.html Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/effecteval/effect.html Mon Jun 08 02:08:25 2015 +0000 @@ -7,6 +7,8 @@ +
starting...
+ Effects /
diff -r 896979e6f352 -r e703b3434dbd light9/effecteval/index.coffee --- a/light9/effecteval/index.coffee Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/effecteval/index.coffee Mon Jun 08 02:08:25 2015 +0000 @@ -21,7 +21,7 @@ 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 -r 896979e6f352 -r e703b3434dbd light9/effecteval/index.html --- a/light9/effecteval/index.html Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/effecteval/index.html Mon Jun 08 02:08:25 2015 +0000 @@ -6,6 +6,7 @@ +
starting...
/stats

Effect instances

View all songs
diff -r 896979e6f352 -r e703b3434dbd light9/networking.py --- a/light9/networking.py Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/networking.py Mon Jun 08 02:08:25 2015 +0000 @@ -35,15 +35,16 @@ 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 -r 896979e6f352 -r e703b3434dbd light9/rdfdb/web/graphView.xhtml --- a/light9/rdfdb/web/graphView.xhtml Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/rdfdb/web/graphView.xhtml Mon Jun 08 02:08:25 2015 +0000 @@ -13,8 +13,8 @@ graph all the time --> -

status: starting...

- +
starting...
+
Messages
diff -r 896979e6f352 -r e703b3434dbd light9/rdfdb/web/index.xhtml --- a/light9/rdfdb/web/index.xhtml Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/rdfdb/web/index.xhtml Mon Jun 08 02:08:25 2015 +0000 @@ -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 -r 896979e6f352 -r e703b3434dbd light9/rdfdb/web/syncedgraph.js --- a/light9/rdfdb/web/syncedgraph.js Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/rdfdb/web/syncedgraph.js Mon Jun 08 02:08:25 2015 +0000 @@ -23,5 +23,5 @@ $('#out').append($('
').text(JSON.stringify(d))); } - reconnectingWebSocket("ws://localhost:8051/liveSyncedGraph", onMessage); + reconnectingWebSocket("liveSyncedGraph", onMessage); } diff -r 896979e6f352 -r e703b3434dbd light9/subcomposer/index.html --- a/light9/subcomposer/index.html Mon Jun 08 00:38:49 2015 +0000 +++ b/light9/subcomposer/index.html Mon Jun 08 02:08:25 2015 +0000 @@ -44,7 +44,7 @@ - +