diff --git a/debug.sh b/debug.sh new file mode 100755 index 0000000..c8d5bed --- /dev/null +++ b/debug.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +#HOST='0.0.0.0' # Permite la conexión remota +HOST='127.0.0.1' #Permite solo conexiones locales + +#PORT='6000' # Por defecto elige un puerto al azar. + +python3 web-interface/debug.py $HOST $PORT diff --git a/web-interface/debug.py b/web-interface/debug.py index cac9f82..e8e040f 100644 --- a/web-interface/debug.py +++ b/web-interface/debug.py @@ -1,4 +1,17 @@ +import sys from basicweb import app if __name__ == "__main__": - app.run(host= '0.0.0.0') + if len(sys.argv) == 3: + host = sys.argv[1] + port = sys.argv[2] + elif len(sys.argv) == 2: + import random + host = sys.argv[1] + port = random.randrange(3000,9000,1) + else: + import random + host = '127.0.0.1' + port = random.randrange(3000,9000,1) + + app.run(host=host, port=port)