Skip to content

Commit b204eb6

Browse files
committed
debug
1 parent e32c863 commit b204eb6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

device/sdk/python/SecAutoBan/websocket_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, server_ip: str, server_port: int, sk: str, client_type: str,
4141
def sync_block_ip(self, cidr_list):
4242
self.sync_flag = True
4343
if self.enable_cidr is False:
44-
cidr_list = [ip for cidr in cidr_list for ip in ipaddress.ip_network(cidr).hosts()]
44+
cidr_list = [str(ip) for cidr in cidr_list for ip in ipaddress.ip_network(cidr).hosts()]
4545
util.print("[+] 同步全量封禁IP库: " + str(len(cidr_list)) + "个")
4646
device_all_block_ip = self.get_all_block_ip()
4747
for deviceIp in device_all_block_ip:
@@ -67,15 +67,15 @@ def on_message(self, w, message):
6767
self.block_ip(message["data"]["cidr"])
6868
else:
6969
for ip in ipaddress.ip_network(message["data"]["cidr"]).hosts():
70-
self.block_ip(ip)
70+
self.block_ip(str(ip))
7171
return
7272
if message["method"] == "unblockCidr":
7373
util.print("[+] 解禁IP: " + message["data"]["cidr"])
7474
if self.enable_cidr:
7575
self.unblock_ip(message["data"]["cidr"])
7676
else:
7777
for ip in ipaddress.ip_network(message["data"]["cidr"]).hosts():
78-
self.unblock_ip(ip)
78+
self.unblock_ip(str(ip))
7979
return
8080
if message["method"] == "sync":
8181
if self.get_all_block_ip is None:

device/sdk/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="SecAutoBan",
8-
version="3.3.0",
8+
version="3.3.1",
99
author="SecReport",
1010
author_email="secaegis@outlook.com",
1111
description="SecAutoBan SDK",

0 commit comments

Comments
 (0)