diff options
| author | Will Hawkins <[email protected]> | 2022-12-12 10:02:04 -0500 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-12-12 10:02:04 -0500 |
| commit | 3c59340e315d860f1c39d3d41e808770d0b91697 (patch) | |
| tree | b3469bf22d769e1d57b777c57a14c6c9e0a2f4e4 /rpm | |
| parent | d0432fdf26e91a6d91534b450112492aabe3a896 (diff) | |
[Feature] Add support for test_endpoint
When a test_endpoint is returned in the config for a test, all
requests will be sent to that host but the :authority pseudo header
(nee: Host: message header) will contain the host specified in
the various `_url` fields of the config data.
Diffstat (limited to 'rpm')
| -rw-r--r-- | rpm/rpm.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -56,7 +56,8 @@ func addFlows( } type ProbeConfiguration struct { - URL string + URL string + Host string } type ProbeDataPoint struct { @@ -111,6 +112,7 @@ func Probe( waitGroup *sync.WaitGroup, client *http.Client, probeUrl string, + probeHost string, // optional: for use with a test_endpoint probeType ProbeType, result *chan ProbeDataPoint, debugging *debug.DebugWithPrefix, @@ -138,6 +140,10 @@ func Probe( return err } + // To support test_endpoint + if len(probeHost) != 0 { + probe_req.Host = probeHost + } // Used to disable compression probe_req.Header.Set("Accept-Encoding", "identity") @@ -296,6 +302,7 @@ func CombinedProber( &wg, foreignProbeClient, foreignProbeConfiguration.URL, + foreignProbeConfiguration.Host, Foreign, &dataPoints, debugging, @@ -307,6 +314,7 @@ func CombinedProber( &wg, selfDownProbeConnection.Client(), selfProbeConfiguration.URL, + selfProbeConfiguration.Host, SelfDown, &dataPoints, debugging, @@ -318,6 +326,7 @@ func CombinedProber( &wg, selfUpProbeConnection.Client(), selfProbeConfiguration.URL, + selfProbeConfiguration.Host, SelfUp, &dataPoints, debugging, |
