mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-30 23:17:14 +00:00
fix(outbound): measure HTTP test delay on a warm connection
Since the batched prober replaced the single tester, the reported delay came from one cold request with keep-alives disabled, so it stacked the SOCKS handshake, proxy dial, proxy TLS, target TCP and target TLS on top of the round-trip. Users upgrading from v2.9.4 - whose tester warmed the connection first and timed a second request - saw several times the real connection time. The cold request still proves reachability and supplies the HTTP status plus the connect/TLS/TTFB breakdown; the delay is now re-measured on a second request over the kept-alive connection, falling back to the cold total when the warm request fails. Bodies are drained (bounded) so the connection returns to the pool, and the batch test asserts both requests of a probe share one connection.
This commit is contained in:
@@ -111,8 +111,9 @@ func (s *OutboundService) ResetOutboundTraffic(tag string) error {
|
||||
|
||||
// TestOutboundResult represents the result of testing an outbound.
|
||||
// Delay is in milliseconds. Endpoints is only populated for TCP-mode
|
||||
// probes; HTTP mode reports the time of a real HTTP request routed
|
||||
// through the outbound, with an optional timing breakdown.
|
||||
// probes; HTTP mode reports the round-trip of a real HTTP request on an
|
||||
// established connection through the outbound (the cold first request
|
||||
// supplies the timing breakdown).
|
||||
type TestOutboundResult struct {
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Success bool `json:"success"`
|
||||
|
||||
Reference in New Issue
Block a user