Files
@ d5e99fee786d
Branch filter:
Location: light9/bin/homepageConfig - annotation
d5e99fee786d
1.1 KiB
text/plain
twisted uses zmq (not xmlrpc) to send levels to dmxserver
Ignore-this: 78d627e1ff8c8e83b50ae099d373b8c1
Ignore-this: 78d627e1ff8c8e83b50ae099d373b8c1
0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd e703b3434dbd 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b | #!bin/python
from run_local import log
from rdflib import RDF, URIRef
from light9 import networking, showconfig
from light9.namespaces import L9
from light9.rdfdb.syncedgraph import SyncedGraph
from twisted.internet import reactor
graph = SyncedGraph(networking.rdfdb.url, "homepageConfig")
@graph.initiallySynced.addCallback
def printConfig(result):
with graph.currentState() as current:
netHome = current.value(showconfig.showUri(), L9['networking'])
for role, server in current.predicate_objects(netHome):
if not server.startswith('http'):
continue
path = current.value(role, L9['urlPath'])
server = server.rstrip('/')
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()
reactor.run()
|