Changeset 548
- Timestamp:
- 10/10/08 08:26:54 (6 weeks ago)
- Location:
- trunk/daemon
- Files:
-
- 5 modified
-
orbited-debug.cfg (modified) (1 diff)
-
orbited/config.py (modified) (1 diff)
-
orbited/start.py (modified) (4 diffs)
-
orbited/static/Orbited.js (modified) (1 diff)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/orbited-debug.cfg
r545 r548 2 2 reactor=epoll 3 3 proxy.enabled=1 4 morbid.enabled=1 4 5 session.ping_interval = 60 5 6 session.ping_timeout = 70 -
trunk/daemon/orbited/config.py
r545 r548 8 8 #'reactor': 'epoll', 9 9 10 #'proxy.enabled': '1', 11 10 'proxy.enabled': '1', 12 11 'pid.location': '/tmp/orbited.pid', 13 12 'session.ping_interval': '30', -
trunk/daemon/orbited/start.py
r545 r548 25 25 reactor.listenWith(port_class, factory=factory_class(), resource=root, childName=child_path) 26 26 logger.info('%s protocol active' % config_key) 27 27 28 28 def _setup_static(root, config): 29 29 from twisted.web import static … … 46 46 global logger; logger = logging.get_logger('orbited.start') 47 47 48 48 49 # NB: we need to install the reactor before using twisted. 49 50 reactor_name = config.map['[global]'].get('reactor') … … 61 62 static_files = static.File(os.path.join(os.path.dirname(__file__), 'static')) 62 63 root.putChild('static', static_files) 64 #static_files.putChild('orbited.swf', static.File(os.path.join(os.path.dirname(__file__), 'flash', 'orbited.swf'))) 63 65 site = server.Site(root) 64 66 … … 70 72 def start_listening(site, config, logger): 71 73 from twisted.internet import reactor 74 # allow stomp:// URIs to be parsed by urlparse 75 urlparse.uses_netloc.append('stomp') 76 72 77 for addr in config['[listen]']: 73 78 url = urlparse.urlparse(addr) 74 79 hostname = url.hostname or '' 75 if url.scheme == 'http': 80 if url.scheme == 'stomp': 81 logger.info('Listening stomp@%s' % url.port) 82 from morbid import StompFactory 83 reactor.listenTCP(url.port, StompFactory(), interface=hostname) 84 elif url.scheme == 'http': 76 85 logger.info('Listening http@%s' % url.port) 77 86 reactor.listenTCP(url.port, site, interface=hostname) -
trunk/daemon/orbited/static/Orbited.js
r547 r548 2531 2531 Orbited.JSON = JSON; 2532 2532 2533 2533 2534 })(); 2535 2536 2537 // Try to auto detect the Orbited port and hostname 2538 (function() { 2539 try { 2540 var scripts = document.getElementsByTagName('script') 2541 for (var i = 0; i < scripts.length; ++i) { 2542 var script = scripts[0] 2543 if (script.src.match('/static/Orbited\.js$')) { 2544 var url = new Orbited.URL(script.src) 2545 Orbited.settings.hostname = url.domain; 2546 Orbited.settings.port = url.port; 2547 break 2548 } 2549 } 2550 } catch(e) { } 2551 })() -
trunk/daemon/setup.py
r545 r548 15 15 ] 16 16 17 _install_requires = [ "demjson" ]17 _install_requires = [ "demjson", "morbid" ] 18 18 19 19 #if sys.platform != "win32":