| skipped 6 lines |
7 | 7 | | |
8 | 8 | | // GetHTTPClient retrieves a pointer to an http.Client powered by MysteryDialer. |
9 | 9 | | func (s *Swamp) GetHTTPClient() *http.Client { |
10 | | - | return &http.Client{ |
| 10 | + | if s.httpClient != nil { |
| 11 | + | return s.httpClient |
| 12 | + | } |
| 13 | + | s.httpClient = &http.Client{ |
11 | 14 | | Transport: &http.Transport{ |
12 | 15 | | DialContext: s.DialContext, |
13 | 16 | | DisableKeepAlives: true, |
| skipped 2 lines |
16 | 19 | | }, |
17 | 20 | | Timeout: s.GetServerTimeout(), |
18 | 21 | | } |
| 22 | + | return s.httpClient |
19 | 23 | | } |
20 | 24 | | |
21 | 25 | | // RoundTrip is Mr. WorldWide. Obviously. See: https://pkg.go.dev/net/http#RoundTripper |
| skipped 4 lines |