diff --git a/mutalyzer/entrypoints/service_json.py b/mutalyzer/entrypoints/service_json.py index ae8955ff9d6b126cfce53a799ed737a297a09673..25ff8bbfc1d7d3a01a49a375a6caba90b846aed3 100644 --- a/mutalyzer/entrypoints/service_json.py +++ b/mutalyzer/entrypoints/service_json.py @@ -42,12 +42,12 @@ if settings.REVERSE_PROXIED: application = _ReverseProxied(application) -def debugserver(port): +def debugserver(host, port): """ Run the webservice with the Python built-in HTTP server. """ - sys.stderr.write('Listening on http://localhost:%d/\n' % port) - make_server('localhost', port, application).serve_forever() + sys.stderr.write('Listening on http://%s:%d/\n' % (host, port)) + make_server(host, port, application).serve_forever() def main(): @@ -57,11 +57,15 @@ def main(): parser = argparse.ArgumentParser( description='Mutalyzer HTTP/RPC+JSON webservice.') parser.add_argument( - '-p', '--port', metavar='NUMBER', dest='port', type=int, - default=8082, help='port to run the webservice on (default: 8082)') + '-H', '--host', metavar='HOSTNAME', dest='host', default='127.0.0.1', + help='hostname to listen on (default: 127.0.0.1; specify 0.0.0.0 to ' + 'listen on all hostnames)') + parser.add_argument( + '-p', '--port', metavar='PORT', dest='port', type=int, + default=8082, help='port to listen on (default: 8082)') args = parser.parse_args() - debugserver(args.port) + debugserver(args.host, args.port) if __name__ == '__main__': diff --git a/mutalyzer/entrypoints/service_soap.py b/mutalyzer/entrypoints/service_soap.py index b8c1426d1afa714f230cbb55abb16a35a9e1d599..6b630ad6aa1bc885995e099bca91553260854b0d 100644 --- a/mutalyzer/entrypoints/service_soap.py +++ b/mutalyzer/entrypoints/service_soap.py @@ -42,13 +42,13 @@ if settings.REVERSE_PROXIED: application = _ReverseProxied(application) -def debugserver(port): +def debugserver(host, port): """ Run the webservice with the Python built-in HTTP server. """ - sys.stderr.write('Listening on http://localhost:%d/\n' % port) - sys.stderr.write('WDSL file is at http://localhost:%d/?wsdl\n' % port) - make_server('localhost', port, application).serve_forever() + sys.stderr.write('Listening on http://%s:%d/\n' % (host, port)) + sys.stderr.write('WDSL file is at http://%s:%d/?wsdl\n' % (host, port)) + make_server(host, port, application).serve_forever() def main(): @@ -58,11 +58,15 @@ def main(): parser = argparse.ArgumentParser( description='Mutalyzer SOAP webservice.') parser.add_argument( - '-p', '--port', metavar='NUMBER', dest='port', type=int, - default=8081, help='port to run the webservice on (default: 8081)') + '-H', '--host', metavar='HOSTNAME', dest='host', default='127.0.0.1', + help='hostname to listen on (default: 127.0.0.1; specify 0.0.0.0 to ' + 'listen on all hostnames)') + parser.add_argument( + '-p', '--port', metavar='PORT', dest='port', type=int, + default=8081, help='port to listen on (default: 8081)') args = parser.parse_args() - debugserver(args.port) + debugserver(args.host, args.port) if __name__ == '__main__': diff --git a/mutalyzer/entrypoints/website.py b/mutalyzer/entrypoints/website.py index 12e855a28474cac13f909597ace42f48edfe8a1d..a62e3bb332322312191d4f8eff800d711608037b 100644 --- a/mutalyzer/entrypoints/website.py +++ b/mutalyzer/entrypoints/website.py @@ -52,11 +52,11 @@ if settings.REVERSE_PROXIED: application.wsgi_app = _ReverseProxied(application.wsgi_app) -def debugserver(port): +def debugserver(host, port): """ Run the website with the Python built-in HTTP server. """ - application.run(port=port, debug=True, use_reloader=False) + application.run(host=host, port=port, debug=True, use_reloader=False) def main(): @@ -66,11 +66,15 @@ def main(): parser = argparse.ArgumentParser( description='Mutalyzer website.') parser.add_argument( - '-p', '--port', metavar='NUMBER', dest='port', type=int, - default=8089, help='port to run the website on (default: 8080)') + '-H', '--host', metavar='HOSTNAME', dest='host', default='127.0.0.1', + help='hostname to listen on (default: 127.0.0.1; specify 0.0.0.0 to ' + 'listen on all hostnames)') + parser.add_argument( + '-p', '--port', metavar='PORT', dest='port', type=int, + default=8089, help='port to listen on (default: 8080)') args = parser.parse_args() - debugserver(args.port) + debugserver(args.host, args.port) if __name__ == '__main__':