Handle both ipv6 and ipv4 interfaces together

This commit is contained in:
Ashwin Bharambe 2024-10-24 13:36:41 -07:00
parent 0538cc297e
commit 94728d6983

View file

@ -337,7 +337,8 @@ def main(
import uvicorn
# FYI this does not do hot-reloads
listen_host = "::" if not disable_ipv6 else "0.0.0.0"
listen_host = ["::", "0.0.0.0"] if not disable_ipv6 else "0.0.0.0"
print(f"Listening on {listen_host}:{port}")
uvicorn.run(app, host=listen_host, port=port)