Use native dialer for scout

This commit is contained in:
9seconds
2026-03-12 21:47:03 +01:00
parent a85348d6be
commit cc63e762e3
3 changed files with 13 additions and 3 deletions
+3 -2
View File
@@ -79,18 +79,19 @@ func (s Scout) learn(ctx context.Context, url string) ([]time.Duration, error) {
}
func (s Scout) makeClient() (*http.Client, *ScoutConnCollected) {
dialer := s.network.NativeDialer()
collected := NewScoutConnCollected()
client := s.network.MakeHTTPClient(func(
ctx context.Context,
network string,
address string,
) (essentials.Conn, error) {
conn, err := s.network.DialContext(ctx, network, address)
conn, err := dialer.DialContext(ctx, network, address)
if err != nil {
return nil, err
}
return NewScoutConn(conn, collected), nil
return NewScoutConn(essentials.WrapNetConn(conn), collected), nil
})
return client, collected