pub struct GatewayConfig {
pub auth_server: String,
pub account: String,
pub password: String,
pub password_is_md5: bool,
pub region: String,
pub listen_addr: String,
pub device_id: String,
pub app_lang: i32,
pub client_type: u8,
pub setup_only: bool,
pub client_sig_proactive_refresh: bool,
pub client_sig_reactive_refresh: bool,
}Expand description
网关配置
Fields§
§auth_server: String认证服务器 URL
account: String登录账号
password: String密码:password_is_md5 = false 时是明文(内部做 MD5);
password_is_md5 = true 时是 32 位小写 hex MD5(直接用)
对齐 C++ FutuOpenD:两者都存在时优先 md5
password_is_md5: bool是否为预哈希 MD5
region: String后端服务器区域 (gz/sh/hk)
listen_addr: StringAPI 服务监听地址
device_id: String设备 ID
app_lang: i32App 语言: 0=简体 1=繁体 2=英文 5=日文 (对应 C++ NN_AppLanguage)
client_type: u8C++ AppConfig::GetClientTypeValue(): 40=牛牛 FTNN, 60=moomoo FTMM
setup_only: boolv1.4.21: --setup-only 语义——仅完成 HTTP auth + credentials 缓存后
立即返回,不做 Platform TCP login / broker 通道建立 / CMD 2282
账户拉取 / CMD 6822 市场注册 / CMD 6823 市场状态 等后续步骤。
背景:v1.4.17 --setup-only 的实现是 initialize() 跑完所有 step,
然后上层 main.rs 检测 config.setup_only 再 return。但
后半段 step 4-7 对 setup 目的没意义(我们只想把 credentials 存下来),
白白浪费 ~14 秒 + 无谓服务端请求(包括 v1.4.20 踩坑的 CMD 1321)。
v1.4.21 起 initialize() 内部识别这个 flag,Step 1 auth 成功就
提前 return。
client_sig_proactive_refresh: boolLong-runner opt-in: proactively refresh client_sig before expiry.
Default is false. Env FUTU_CLIENT_SIG_PROACTIVE_REFRESH=1 remains a
compatible override in gateway-core.
client_sig_reactive_refresh: boolLong-runner opt-in: reactively refresh client_sig after repeated TCP login failures.
Default is false. Env FUTU_CLIENT_SIG_REACTIVE_REFRESH=1 remains a
compatible override in gateway-core.
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more