Fix: keep the local FRP address and align the MCP read-only preset
A subordinate that already runs its own FRP proxy must keep advertising its own master address: the upstream auto FRP is only a fallback entry and should not overwrite the address baked into generated clients and kernel payloads. GetEffectiveMasterAddress now returns the local address when [frp] UseFrp is on and a master address is configured; otherwise the upstream address is used exactly as before. The startup banner, the hot switch tips and the settings dialog follow the same rule, and the dialog now explains under the field when the address is supplied by the upstream FRP. The MCP settings dialog's read-only preset now unchecks every other tool switch (file transfer, host management, chat, keylog), matching the smart preset and the first-open state; previously Smart followed by Read-only left those four checked. The FRP auto-proxy messages now go through _TRF and the three language files carry the new local-FRP variants and the upstream-address hint. Verified: build.cmd server passes; the default (no local FRP) path is unchanged. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
a6c417a061
commit
b0e172bf91
7 files changed
+58
-8
No files matched your search
@@ -130,11 +130,14 @@ BOOL CSettingDlg::OnInitDialog()
|
||||
SetDlgItemText(IDC_STATIC_SET_PUBLIC_IP, _TR("公网地址:"));
|
||||
m_sPublicIP = savedMaster.empty() ? localPublicIP.c_str() : savedMaster.c_str();
|
||||
SetDlgItemText(IDC_STATIC_SET_IP_HINT, _T(""));
|
||||
} else if (!frpAutoServer.empty()) {
|
||||
} else if (!frpAutoServer.empty() && !(frpEnabled && !savedMaster.empty())) {
|
||||
// 场景 2: 上级配置了 FRP
|
||||
// 本地已启用自有 FRP(UseFrp + 已配置主控地址)时不走这里:
|
||||
// 此时主控地址以本地 FRP 为准,与 GetEffectiveMasterAddress 的规则一致。
|
||||
SetDlgItemText(IDC_STATIC_SET_PUBLIC_IP, _TR("公网地址:"));
|
||||
m_sPublicIP = frpAutoServer.c_str();
|
||||
SetDlgItemText(IDC_STATIC_SET_IP_HINT, _T(""));
|
||||
SetDlgItemText(IDC_STATIC_SET_IP_HINT,
|
||||
_TR("该地址由上级自动 FRP 提供(端口由上级分配),无需修改"));
|
||||
} else if (frpEnabled) {
|
||||
// 场景 3: 启用了本地 FRP(FRP服务器应有公网IP)
|
||||
SetDlgItemText(IDC_STATIC_SET_PUBLIC_IP, _TR("公网地址:"));
|
||||
|
||||
Reference in new issue
Block a user