diff --git a/README.md b/README.md index d48af06..3bb044e 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,8 @@ Will use HTTP/3 to query the specified URL with the specified data, method and h The port and address can be changed in config.toml, located in the default OS config location. ```toml -# Host address to bind to -host = "0.0.0.0" -# Port to listen on -port = 7192 +# Host address to listen on +listen = "0.0.0.0:7192" # Amount of workers to process quic requests open_connections = 5 ``` diff --git a/main.py b/main.py index 4dce8f5..b0c1c45 100644 --- a/main.py +++ b/main.py @@ -23,7 +23,7 @@ CONFIG_FILE.touch(exist_ok=True) with open(f"{CONFIG_FILE}") as config: config = pytomlpp.loads(config.read()) if not config: - config = {"port": 7192, "host": "0.0.0.0", "open_connections": 5} + config = {"listen": "0.0.0.0:7192", "open_connections": 5} routes = web.RouteTableDef() @@ -78,4 +78,6 @@ async def main(): request_processor = quicclient.RequestProcessor() if __name__ == '__main__': process_cli_args() - web.run_app(main(), port=config.get("port", 7912), host=config.get("host", "0.0.0.0")) + + address, port = config.get("listen", "0.0.0.0:7912").split(":") + web.run_app(main(), port=port, host=address)