|
@@ -20,6 +20,8 @@ def debug(line):
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
def process(info, line):
|
|
def process(info, line):
|
|
|
|
|
+ regex_listen = re.compile(
|
|
|
|
|
+ ".* Listening on (\d+[.]\d+[.]\d+[.]\d+:\d+)")
|
|
|
regex_inbound_connect = re.compile(
|
|
regex_inbound_connect = re.compile(
|
|
|
".* Connected inbound \[(\d+[.]\d+[.]\d+[.]\d+:\d+)\]")
|
|
".* Connected inbound \[(\d+[.]\d+[.]\d+[.]\d+:\d+)\]")
|
|
|
regex_outbound_slots = re.compile(
|
|
regex_outbound_slots = re.compile(
|
|
@@ -43,6 +45,9 @@ def process(info, line):
|
|
|
info["status"] = "p2p-run"
|
|
info["status"] = "p2p-run"
|
|
|
elif "Not configured for accepting incoming connections." in line:
|
|
elif "Not configured for accepting incoming connections." in line:
|
|
|
info["inbounds"] = ["Disabled"]
|
|
info["inbounds"] = ["Disabled"]
|
|
|
|
|
+ elif (match := regex_listen.match(line)) is not None:
|
|
|
|
|
+ address = match.group(1)
|
|
|
|
|
+ info["listen"] = address
|
|
|
elif (match := regex_inbound_connect.match(line)) is not None:
|
|
elif (match := regex_inbound_connect.match(line)) is not None:
|
|
|
address = match.group(1)
|
|
address = match.group(1)
|
|
|
info["inbounds"].append(address)
|
|
info["inbounds"].append(address)
|
|
@@ -106,6 +111,9 @@ def table_format(ninfo):
|
|
|
table_data.append([filename, "", ""])
|
|
table_data.append([filename, "", ""])
|
|
|
table_data.append(["", "status", info["status"]])
|
|
table_data.append(["", "status", info["status"]])
|
|
|
|
|
|
|
|
|
|
+ if "listen" in info:
|
|
|
|
|
+ table_data.append(["", "listen", info["listen"]])
|
|
|
|
|
+
|
|
|
inbounds = info["inbounds"]
|
|
inbounds = info["inbounds"]
|
|
|
if inbounds:
|
|
if inbounds:
|
|
|
table_data.append(["", "inbounds", inbounds[0],
|
|
table_data.append(["", "inbounds", inbounds[0],
|