From a4fb1c04f29cdc0cd721e0de3aebe8ca218f05d7 Mon Sep 17 00:00:00 2001 From: Dmitry Tokarev Date: Tue, 28 Jul 2020 12:32:30 -0700 Subject: [PATCH 1/2] Print valid URL when --web-host is not specified --- locust/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locust/main.py b/locust/main.py index 043251fe39..2c788059b1 100644 --- a/locust/main.py +++ b/locust/main.py @@ -235,13 +235,13 @@ def timelimit_stop(): if not options.headless and not options.worker: # spawn web greenlet protocol = "https" if options.tls_cert and options.tls_key else "http" - logger.info("Starting web interface at %s://%s:%s" % (protocol, options.web_host, options.web_port)) try: if options.web_host == "*": # special check for "*" so that we're consistent with --master-bind-host web_host = '' else: web_host = options.web_host + logger.info("Starting web interface at %s://%s:%s" % (protocol, web_host if web_host else '127.0.0.1', options.web_port)) web_ui = environment.create_web_ui( host=web_host, port=options.web_port, From d3d5e5389e4cf0e4264bb9117dd36cefd046986f Mon Sep 17 00:00:00 2001 From: Dmitry Tokarev Date: Wed, 29 Jul 2020 12:53:11 -0700 Subject: [PATCH 2/2] Note to users when --web-host is not specified --- locust/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locust/main.py b/locust/main.py index 2c788059b1..61a880924e 100644 --- a/locust/main.py +++ b/locust/main.py @@ -241,7 +241,10 @@ def timelimit_stop(): web_host = '' else: web_host = options.web_host - logger.info("Starting web interface at %s://%s:%s" % (protocol, web_host if web_host else '127.0.0.1', options.web_port)) + if web_host: + logger.info("Starting web interface at %s://%s:%s" % (protocol, web_host, options.web_port)) + else: + logger.info("Starting web interface at %s://0.0.0.0:%s (accepting connections from all network interfaces)" % (protocol, options.web_port)) web_ui = environment.create_web_ui( host=web_host, port=options.web_port,