ws-sta-monitor: added --host argument

This commit is contained in:
Jed Reynolds
2020-02-28 14:06:12 -08:00
parent 27fa1b66e1
commit 43026de8f2

View File

@@ -63,6 +63,21 @@ def main():
global websock global websock
host = "localhost" host = "localhost"
base_url = "ws://%s:8081"%host base_url = "ws://%s:8081"%host
resource_id = 1 # typically you're using resource 1 in stand alone realm
parser = argparse.ArgumentParser(description="test creating a station")
parser.add_argument("-m", "--host", type=str, help="json host to connect to")
args = None
try:
args = parser.parse_args()
if (args.host is not None):
host = args.host,
baseurl = base_url = "ws://%s:8081"%host
except Exception as e:
logging.exception(e)
usage()
exit(2)
# open websocket # open websocket
websock = start_websocket(base_url, websock) websock = start_websocket(base_url, websock)