Update main.py

This commit is contained in:
Keno Chou 2024-10-20 23:04:43 +08:00 committed by GitHub
parent 4111d1dff2
commit 36880c988f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ if __name__ == "__main__":
def startup_server(scheme, address, port):
import webbrowser
if os.name == 'nt' and address == '0.0.0.0':
address = '127.0.0.1'
log.info(address)
if ':' in address:
address = "[{}]".format(address)
webbrowser.open(f"{scheme}://{address}:{port}")