Wrapper to run async scanner from sync context (e.g. main.py). Args: front_domain: The SNI hostname to use. Returns: True if at least one IP is reachable, False otherwise.
(front_domain: str)
| 175 | |
| 176 | |
| 177 | def scan_sync(front_domain: str) -> bool: |
| 178 | """ |
| 179 | Wrapper to run async scanner from sync context (e.g. main.py). |
| 180 | |
| 181 | Args: |
| 182 | front_domain: The SNI hostname to use. |
| 183 | |
| 184 | Returns: |
| 185 | True if at least one IP is reachable, False otherwise. |
| 186 | """ |
| 187 | try: |
| 188 | return asyncio.run(run(front_domain)) |
| 189 | except KeyboardInterrupt: |
| 190 | print("\nScan interrupted by user.") |
| 191 | return False |
| 192 | except Exception as e: |
| 193 | log.error(f"Scan failed: {e}") |
| 194 | return False |