[etwist] add an 'interface' config option (passed to reactor.listenTCP) stable cubicweb-version-3.10.7
authordavid.douard@logilab.fr
Thu, 13 Jan 2011 13:38:49 +0100
branchstable
changeset 6817 1959d97ebf2e
parent 6816 f61de39cd396
child 6818 5fa425574548
child 6819 bf5d9a1415e3
[etwist] add an 'interface' config option (passed to reactor.listenTCP)
etwist/server.py
etwist/twconfig.py
--- a/etwist/server.py	Thu Jan 13 12:49:44 2011 +0100
+++ b/etwist/server.py	Thu Jan 13 13:38:49 2011 +0100
@@ -408,7 +408,8 @@
     website = server.Site(root_resource)
     # serve it via standard HTTP on port set in the configuration
     port = config['port'] or 8080
-    reactor.listenTCP(port, website)
+    interface = config['interface']
+    reactor.listenTCP(port, website, interface=interface)
     if not config.debugmode:
         if sys.platform == 'win32':
             raise ConfigurationError("Under windows, you must use the service management "
--- a/etwist/twconfig.py	Thu Jan 13 12:49:44 2011 +0100
+++ b/etwist/twconfig.py	Thu Jan 13 13:38:49 2011 +0100
@@ -45,6 +45,12 @@
           'help': 'http server port number (default to 8080)',
           'group': 'web', 'level': 0,
           }),
+        ('interface',
+         {'type' : 'string',
+          'default': "",
+          'help': 'http server address on which to listen (default to everywhere)',
+          'group': 'web', 'level': 0,
+          }),
         ('max-post-length',
          {'type' : 'bytes',
           'default': '100MB',