diff --git a/oneforall/common/request.py b/oneforall/common/request.py index 8db18ff..577147c 100644 --- a/oneforall/common/request.py +++ b/oneforall/common/request.py @@ -22,12 +22,8 @@ def get_limit_conn(): def get_ports(port): logger.log('DEBUG', f'正在获取请求探测端口范围') ports = set() - if isinstance(port, set): + if isinstance(port, (set, list, tuple)): ports = port - elif isinstance(port, list): - ports = set(port) - elif isinstance(port, tuple): - ports = set(port) elif isinstance(port, int): if 0 <= port <= 65535: ports = {port} @@ -38,7 +34,7 @@ def get_ports(port): logger.log('ERROR', f'指定探测端口范围有误') ports = {80} logger.log('INFOR', f'探测端口范围:{ports}') - return ports + return set(ports) def gen_new_datas(datas, ports): diff --git a/oneforall/config.py b/oneforall/config.py index d5b8b2a..05506c2 100644 --- a/oneforall/config.py +++ b/oneforall/config.py @@ -85,16 +85,16 @@ resolver_lifetime = 30.0 # 解析存活时间 limit_resolve_conn = 500 # 限制同一时间解析的数量(默认500) # 请求端口探测设置 -default_ports = {80} # 默认使用 -small_ports = {80, 443, 8000, 8080, 8443} +default_ports = [80] # 默认使用 +small_ports = [80, 443, 8000, 8080, 8443] # 可以在这里面添加端口 -large_ports = {80, 81, 280, 300, 443, 591, 593, 832, 888, 901, 981, 1010, 1080, +large_ports = [80, 81, 280, 300, 443, 591, 593, 832, 888, 901, 981, 1010, 1080, 1100, 1241, 1311, 1352, 1434, 1521, 1527, 1582, 1583, 1944, 2082, 2082, 2086, 2087, 2095, 2096, 2222, 2301, 2480, 3000, 3128, 3333, 4000, 4001, 4002, 4100, 4125, 4243, 4443, 4444, 4567, 4711, 4712, - 4993, 5000, 5104, 5108, 5432, 5555, 5800, 5801, 5802, 5984, 5985, - 5986, 6082, 6225, 6346, 6347, 6443, 6480, 6543, 6789, 7000, 7001, - 7002, 7396, 7474, 4848, 4849, 7674, 7675, 7777, 7778, 8000, 8001, + 4848, 4849, 4993, 5000, 5104, 5108, 5432, 5555, 5800, 5801, 5802, + 5984, 5985, 5986, 6082, 6225, 6346, 6347, 6443, 6480, 6543, 6789, + 7000, 7001, 7002, 7396, 7474, 7674, 7675, 7777, 7778, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8008, 8009, 8010, 8014, 8042, 8069, 8075, 8080, 8081, 8083, 8088, 8090, 8091, 8092, 8093, 8016, 8118, 8123, 8172, 8181, 8200, 8222, 8243, 8280, 8281, 8333, 8384, 8403, @@ -102,7 +102,7 @@ large_ports = {80, 81, 280, 300, 443, 591, 593, 832, 888, 901, 981, 1010, 1080, 8983, 8989, 8990, 8991, 9000, 9043, 9060, 9080, 9090, 9091, 9200, 9294, 9295, 9443, 9444, 9800, 9981, 9988, 9990, 9999, 10000, 10880, 11371, 12043, 12046, 12443, 15672, 16225, 16080, 18091, - 18092, 20000, 20720, 24465, 28017, 28080, 30821, 43110, 61600} + 18092, 20000, 20720, 24465, 28017, 28080, 30821, 43110, 61600] ports = {'default': default_ports, 'small': small_ports, 'large': large_ports} verify_ssl = False # aiohttp 支持 HTTP/HTTPS形式的代理