mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-14 17:15:24 +03:00
fix(sub): pass numeric XMUX counts to Clash reuse-settings (#6843)
Inbound XMUX counts such as maxConnections are stored as JSON numbers, but buildXhttpClashOpts kept only string values, so the panel default maxConnections: 3 never reached Clash/Mihomo clients. Numeric values are now rendered as plain integers (FormatFloat, so 1000000 does not become 1e+06) and zero values are still dropped.
This commit is contained in:
@@ -1018,8 +1018,15 @@ func buildXhttpClashOpts(xhttp map[string]any) map[string]any {
|
||||
{"hMaxRequestTimes", "h-max-request-times"},
|
||||
{"hMaxReusableSecs", "h-max-reusable-secs"},
|
||||
} {
|
||||
if v, ok := xmux[f.src].(string); ok && v != "" {
|
||||
reuse[f.dst] = v
|
||||
v, ok := nonZeroShareValue(xmux[f.src])
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if n, isFloat := v.(float64); isFloat {
|
||||
// JSON numbers decode as float64, and %v would render 1000000 as "1e+06".
|
||||
reuse[f.dst] = strconv.FormatFloat(n, 'f', -1, 64)
|
||||
} else {
|
||||
reuse[f.dst] = fmt.Sprint(v)
|
||||
}
|
||||
}
|
||||
if v, ok := nonZeroShareValue(xmux["hKeepAlivePeriod"]); ok {
|
||||
|
||||
Reference in New Issue
Block a user