From 3657ed55dcc3aacf55aa0f1a98f54f4778652c04 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 1 Jun 2026 23:14:40 +0200 Subject: [PATCH] fix(warp): persist client_id so WARP outbound gets reserved bytes (#4781) RegWarp now stores config.client_id from the Cloudflare registration, and WarpModal sources the reserved bytes from the live config response (falling back to stored creds). Previously reservedFor read an always-missing client_id, producing an empty reserved array. --- frontend/src/pages/xray/overrides/WarpModal.tsx | 3 ++- web/service/warp.go | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/xray/overrides/WarpModal.tsx b/frontend/src/pages/xray/overrides/WarpModal.tsx index 6a30f8ab..6ba217dd 100644 --- a/frontend/src/pages/xray/overrides/WarpModal.tsx +++ b/frontend/src/pages/xray/overrides/WarpModal.tsx @@ -38,6 +38,7 @@ interface WarpConfig { model?: string; enabled?: boolean; config?: { + client_id?: string; interface?: { addresses?: { v4?: string; v6?: string } }; peers?: { public_key?: string; endpoint?: { host?: string } }[]; }; @@ -99,7 +100,7 @@ export default function WarpModal({ mtu: 1420, secretKey: data?.private_key, address: addressesFor(cfg.interface?.addresses || {}), - reserved: reservedFor(data?.client_id), + reserved: reservedFor(cfg.client_id ?? data?.client_id), domainStrategy: 'ForceIP', peers: [{ publicKey: peer.public_key, endpoint: peer.endpoint?.host }], noKernelTun: false, diff --git a/web/service/warp.go b/web/service/warp.go index fbe39957..fa0a03a2 100644 --- a/web/service/warp.go +++ b/web/service/warp.go @@ -106,6 +106,11 @@ func (s *WarpService) RegWarp(secretKey string, publicKey string) (string, error "license_key": license, "private_key": secretKey, } + if config, ok := rsp["config"].(map[string]any); ok { + if clientID, ok := config["client_id"].(string); ok { + warpData["client_id"] = clientID + } + } warpJSON, err := json.MarshalIndent(warpData, "", " ") if err != nil { return "", err