(
host: str = "0.0.0.0",
port: int = 8080,
no_browser: bool = False,
)
| 602 | |
| 603 | |
| 604 | async def _handle_web( |
| 605 | host: str = "0.0.0.0", |
| 606 | port: int = 8080, |
| 607 | no_browser: bool = False, |
| 608 | ) -> None: |
| 609 | import threading |
| 610 | import webbrowser |
| 611 | |
| 612 | from openosint.web_server import serve_async |
| 613 | |
| 614 | if not no_browser: |
| 615 | display = "localhost" if host in ("0.0.0.0", "") else host |
| 616 | url = f"http://{display}:{port}" |
| 617 | threading.Timer(1.5, lambda: webbrowser.open(url)).start() |
| 618 | |
| 619 | await serve_async(host=host, port=port) |
| 620 | |
| 621 | |
| 622 | # --------------------------------------------------------------------------- |
no test coverage detected