From 487f03864357af25862d350e0f2d4a38a764180b Mon Sep 17 00:00:00 2001 From: Pedro Camelo Date: Wed, 19 Jul 2017 02:02:29 +0100 Subject: [PATCH] Make magneticow listening host available to the user --- magneticow/magneticow/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/magneticow/magneticow/__main__.py b/magneticow/magneticow/__main__.py index 3559058..dd0f777 100644 --- a/magneticow/magneticow/__main__.py +++ b/magneticow/magneticow/__main__.py @@ -29,7 +29,7 @@ def main() -> int: arguments = parse_args() magneticow.app.arguments = arguments - http_server = gevent.wsgi.WSGIServer(("", arguments.port), magneticow.app) + http_server = gevent.wsgi.WSGIServer((arguments.host, arguments.port), magneticow.app) magneticow.initialize_magneticod_db() @@ -67,6 +67,10 @@ def parse_args() -> argparse.Namespace: allow_abbrev=False, formatter_class=argparse.RawDescriptionHelpFormatter ) + parser.add_argument( + "--host", action="store", type=str, required=False, default="", + help="the host address magneticow web server should listen on" + ) parser.add_argument( "--port", action="store", type=int, required=True, help="the port number magneticow web server should listen on"