mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-28 02:16:16 +00:00
add host option
This commit is contained in:
parent
4e544ab257
commit
a6454a10ac
12
server.py
12
server.py
|
@ -267,10 +267,10 @@ def openDownloadsFolder():
|
|||
elif sys.platform == 'win32':
|
||||
subprocess.check_call(['explorer', folder])
|
||||
|
||||
def run_server(port, portable=None):
|
||||
def run_server(port, host, portable=None):
|
||||
app.initialize(portable)
|
||||
print("Starting server at http://127.0.0.1:" + str(port))
|
||||
socketio.run(server, host='0.0.0.0', port=port)
|
||||
print("Starting server at http://" + host + ":" + str(port))
|
||||
socketio.run(server, host=host, port=port)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -284,4 +284,8 @@ if __name__ == '__main__':
|
|||
portable = path.join(path.dirname(path.realpath(__file__)), 'config')
|
||||
else:
|
||||
portable = None
|
||||
run_server(port, portable)
|
||||
if '--host' in sys.argv:
|
||||
host = str(sys.argv[sys.argv.index("--host")+1])
|
||||
else:
|
||||
host = "0.0.0.0"
|
||||
run_server(port, host, portable)
|
||||
|
|
Loading…
Reference in a new issue