parser.add_option("-t", "--tracebacks", help="Display tracebacks in error pages (this reveals a LOT of information, do NOT use in production!)", action="store_true", dest="tracebacks", default=False)
parser.add_option("-r", "--reactor", help="Which reactor to use (see --help-reactors for a list).", dest="reactor", default=DEFAULT_REACTOR)
parser.add_option("-p", "--port", help="Port to start the server on.", type="int", dest="port", default=DEFAULT_PORT)
+parser.add_option("-i", "--ip", help="IP address to listen on.", dest="ip", default="0.0.0.0")
parser.add_option("-l", "--logfile", help="Path to twisted log file.", dest="logfile")
parser.add_option("-c", "--clf", help="Path to web CLF (Combined Log Format) log file.", dest="clogfile")
parser.add_option("-C", "--certificate", help="Path to SSL certificate.", dest="sslcertificate")
else:
args2+=["--port", options.port]
+args2+=["--ip", options.ip]
+
run_twistd(args1, args2)
class Options(usage.Options):
optParameters = [["port", "p", "9090","Port to start the server on."],
+ ["ip", "i", "0.0.0.0", "IP address to listen on."],
["logfile", "l", None, "Path to web CLF (Combined Log Format) log file."],
["https", None, None, "Port to listen on for Secure HTTP."],
["certificate", "c", "server.pem", "SSL certificate to use for HTTPS. "],
site.displayTracebacks = not config["notracebacks"]
if config['https']:
from twisted.internet.ssl import DefaultOpenSSLContextFactory
- i = internet.SSLServer(int(config['https']), site, DefaultOpenSSLContextFactory(config['privkey'], config['certificate']))
+ i = internet.SSLServer(int(config['https']), site, DefaultOpenSSLContextFactory(config['privkey'], config['certificate']), interface=config['ip'])
else:
- i = internet.TCPServer(int(config['port']), site)
+ i = internet.TCPServer(int(config['port']), site, interface=config['ip'])
return i
-serviceMaker = QWebIRCServiceMaker()
\ No newline at end of file
+serviceMaker = QWebIRCServiceMaker()