mirror of
https://gitea.invidious.io/iv-org/Invidious-quic-proxy.git
synced 2024-08-15 00:43:22 +00:00
Merge host and port config into listen
This commit is contained in:
parent
96e780e88e
commit
ca5627516a
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
```
|
||||
|
|
6
main.py
6
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)
|
||||
|
|
Loading…
Reference in a new issue