Skip to main content

Module conn_points

Module conn_points 

Source
Expand description

Platform 通道后端连接点,按 UserAttribution 分池。

完整对齐 C++ FTLogin/Src/ftlogin/channel/impl/address.cpp:495-557 LoadHardcodeAddress()CONN_PLATFORM_* 的条目。每个 IP 后面是 C++ 源里的 Region::kRegion* 字段(gz/sh/hk/us/sg/au/jp),仅作注释。

v1.4.11 前只有 CN 12 个 IP,海外账号(HK/US/SG/AU/JP)首选 IP 命中 CN 池 → 非大陆网络连不通 → 进 offline mode。v1.4.10 的 fallback 逻辑即使有也只 会 fallback 到其他 CN IP,依然死路。修复方式是按 user_attribution 选池。

端口 9595 是 C++ 硬编码的标准端口。 Platform TCP backend IP 池

Constants§

AU
CONN_PLATFORM_AU (address.cpp:542-545)
CN
CONN_PLATFORM_CN (address.cpp:498-511)
HK
CONN_PLATFORM_HK (address.cpp:550-557)
JP
CONN_PLATFORM_JP (address.cpp:546-549)
SG
CONN_PLATFORM_SG (address.cpp:528-541)
US
CONN_PLATFORM_US (address.cpp:512-527)

Functions§

domain_for_attribution
每个 attribution 对应一个公开可解析的域名,启动时 DNS 解析出的 IP 会合并到硬编码池最前面(更新鲜 —— 富途换 IP 我们不用改代码)。
for_attribution
UserAttribution 选对应的 Platform IP 池。
resolve_domain_ips
异步解析某 attribution 对应域名 → Vec<(ip_str, 9595)>。 带 3 秒超时。解析失败 / 无 IP → 返回空 Vec(调用方 fallback 到硬编码池)。