Replaced 0.0.0.0 with 127.0.0.1

if you want to use 0.0.0.0 use the host argument when starting the 
server
This commit is contained in:
RemixDev 2020-06-05 09:58:59 +02:00
parent 9315be7461
commit c403ee720f
2 changed files with 4 additions and 8 deletions

View file

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

View file

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