Returns:
去重键字符串,格式: "address:port:tls:transport_protocol:ws_path"
"""
# 规范化路径(去除末尾斜杠差异)
normalized_path = self.ws_path.rstrip('/') if self.ws_path else '/'
if not normalized_path:
normalized_path = '/'
# 组合核心去重字段(类似 v2rayN: Address, Port, Security, Network, Path)
key_fields = [
str(self.address).lower().strip(), # 服务器地址
str(self.port), # 端口
str(self.tls).lower().strip(), # 安全协议 (tls/none/reality)
str(self.transport_protocol).lower().strip(), # 传输协议 (tcp/ws/grpc等)
normalized_path # 路径
]
return ":".join(key_fields)
def get_dedup_key(self) -> str:
"""
ref v2rayN CompareProfileItem
组合核心字段:Address + Port + Security(TLS) + Network + Path
pls add Splited by protocol:
Vless:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/vless.txt
Hysteria2:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/Hysteria2.txt
Vmess:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/vmess.txt
ss:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/ss.txt
ssr:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/ssr.txt
Trojan:
https://github.com/nikita29a/FreeProxyList/raw/main/Splitted-By-Protocol/trojan.txt