Rename web-iface to web-host

Bug: https://github.com/mitmproxy/mitmproxy/issues/3891
This commit is contained in:
Lucas Ramage 2020-04-05 10:36:09 -04:00
parent 481970d9b8
commit cea443f21c
4 changed files with 7 additions and 7 deletions

View File

@ -127,7 +127,7 @@ def mitmweb(opts):
group = parser.add_argument_group("Mitmweb")
opts.make_parser(group, "web_open_browser")
opts.make_parser(group, "web_port", metavar="PORT")
opts.make_parser(group, "web_iface", metavar="INTERFACE")
opts.make_parser(group, "web_host", metavar="HOST")
common_options(parser, opts)
group = parser.add_argument_group(

View File

@ -105,8 +105,8 @@ class WebMaster(master.Master):
AsyncIOMainLoop().install()
iol = tornado.ioloop.IOLoop.instance()
http_server = tornado.httpserver.HTTPServer(self.app)
http_server.listen(self.options.web_port, self.options.web_iface)
web_url = "http://{}:{}/".format(self.options.web_iface, self.options.web_port)
http_server.listen(self.options.web_port, self.options.web_host)
web_url = "http://{}:{}/".format(self.options.web_host, self.options.web_port)
self.log.info(
"Web server listening at {}".format(web_url),
)

View File

@ -18,13 +18,13 @@ class WebAddon:
"Web UI port."
)
loader.add_option(
"web_iface", str, "127.0.0.1",
"Web UI interface."
"web_host", str, "127.0.0.1",
"Web UI host."
)
def running(self):
if hasattr(ctx.options, "web_open_browser") and ctx.options.web_open_browser:
web_url = "http://{}:{}/".format(ctx.options.web_iface, ctx.options.web_port)
web_url = "http://{}:{}/".format(ctx.options.web_host, ctx.options.web_port)
success = open_browser(web_url)
if not success:
ctx.log.info(

View File

@ -23,7 +23,7 @@ $ docker run --rm -it -p 8080:8080 mitmproxy/mitmproxy mitmdump
For `mitmweb`, you also need to expose port 8081:
```sh
# this makes :8081 accessible to the local machine only
$ docker run --rm -it -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-iface 0.0.0.0
$ docker run --rm -it -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-host 0.0.0.0
```
You can also pass options directly via the CLI: