Skip to content

fix(generator/client): append unit to gRPC/HTTP2 transport timeouts#627

Merged
1715173329 merged 1 commit into
immortalwrt:masterfrom
stupidloud:fix/grpc-transport-timeout-units
Jun 9, 2026
Merged

fix(generator/client): append unit to gRPC/HTTP2 transport timeouts#627
1715173329 merged 1 commit into
immortalwrt:masterfrom
stupidloud:fix/grpc-transport-timeout-units

Conversation

@stupidloud

@stupidloud stupidloud commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • idle_timeout and ping_timeout on outbound transport (gRPC / HTTP2+TLS) were emitted as bare numeric strings (e.g. "15"), but sing-box parses them as Go time.Duration and rejects values without a unit suffix.
  • The server-side generator (generate_server.uc:175-176) and the URLTest generator (generate_client.uc:819) already wrap the same UCI values in strToTime(); this aligns the client outbound transport to behave the same way.

Before: "idle_timeout": "15" → sing-box parse error / field dropped.
After: "idle_timeout": "15s" — matches the sing-box v2ray-transport docs.

Test plan

  • Configure a gRPC or HTTP2+TLS outbound with the Idle timeout / Ping timeout fields set in LuCI.
  • Verify the generated /var/run/homeproxy/sing-box-c.json contains "idle_timeout": "<N>s" / "ping_timeout": "<N>s" rather than bare numbers.
  • Confirm sing-box starts cleanly with the generated config.

`idle_timeout` and `ping_timeout` on the outbound transport were written
as bare numbers (e.g. `"15"`), but sing-box parses them as Go durations
and requires a unit suffix (`"15s"`). The server-side generator and the
URLTest generator already use `strToTime()` for the same fields; align
the client outbound to match.
@stupidloud

Copy link
Copy Markdown
Contributor Author

Reproduction on a live router

Setting Idle timeout / Ping timeout on a gRPC + Reality VLESS node from the LuCI UI and reloading homeproxy produces this in /var/run/homeproxy/homeproxy.log:

2026-06-04 13:42:02 [DAEMON] Reloading service...
2026-06-04 13:42:08 [DAEMON] Service stopped.
FATAL  decode config at /var/run/homeproxy/sing-box-c.json:
       outbounds[3].transport.idle_timeout: time: missing unit in duration "10"
2026-06-04 13:42:09 [DAEMON] Error: wrong client configuration detected.

sing-box refuses to start because outbounds[].transport.idle_timeout is "10" instead of "10s".

CLI workaround until this lands (bypasses the LuCI uinteger validator):

uci set homeproxy.<node>.http_idle_timeout='10s'
uci set homeproxy.<node>.http_ping_timeout='5s'
uci commit homeproxy
/etc/init.d/homeproxy reload

With the patch applied, the numeric UI value (e.g. 10) is routed through strToTime() and the generated JSON contains "idle_timeout": "10s" — sing-box starts cleanly.

@stupidloud

Copy link
Copy Markdown
Contributor Author

这个东西就是,singbox/xtls要求grpc的idle和ping有时间单位,通常是s
而原版generate_client.uc只是原值传递

如果不改,这里就要输入带单位的值
image

但是因为ui类型检查,又无法保存

所以给你 generate_client.uc 补上了时间单位

@1715173329 1715173329 merged commit 4613766 into immortalwrt:master Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants