Fixed IP display on startup

This commit is contained in:
RemixDev 2020-06-05 09:43:16 +02:00
parent 1726fce73f
commit 9315be7461
2 changed files with 7 additions and 3 deletions

View file

@ -47,7 +47,7 @@ if __name__ == '__main__':
portable = path.join(path.dirname(path.realpath(__file__)), 'config') portable = path.join(path.dirname(path.realpath(__file__)), 'config')
else: else:
portable = None portable = None
t = Thread(target=run_server, args=(port, url, portable)) t = Thread(target=run_server, args=(port, "0.0.0.0", portable))
t.daemon = True t.daemon = True
t.start() t.start()

View file

@ -270,9 +270,13 @@ def openDownloadsFolder():
elif sys.platform == 'win32': elif sys.platform == 'win32':
subprocess.check_call(['explorer', folder]) subprocess.check_call(['explorer', folder])
def run_server(port, host, portable=None): def run_server(port, host="0.0.0.0", portable=None):
app.initialize(portable) app.initialize(portable)
print("Starting server at http://" + host + ":" + str(port)) if host == "0.0.0.0":
displayHost = "127.0.0.1"
else:
displayHost = host
print("Starting server at http://" + displayHost + ":" + str(port))
socketio.run(server, host=host, port=port) socketio.run(server, host=host, port=port)