summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2022-12-12 10:02:04 -0500
committerWill Hawkins <[email protected]>2022-12-12 10:02:04 -0500
commit3c59340e315d860f1c39d3d41e808770d0b91697 (patch)
treeb3469bf22d769e1d57b777c57a14c6c9e0a2f4e4 /networkQuality.go
parentd0432fdf26e91a6d91534b450112492aabe3a896 (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 'networkQuality.go')
-rw-r--r--networkQuality.go49
1 files changed, 26 insertions, 23 deletions
diff --git a/networkQuality.go b/networkQuality.go
index 6f6f8ea..c3db256 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -132,7 +132,26 @@ func main() {
)
}
- if err := config.Get(configHostPort, *configPath); err != nil {
+ var sslKeyFileConcurrentWriter *ccw.ConcurrentWriter = nil
+ if *sslKeyFileName != "" {
+ if sslKeyFileHandle, err := os.OpenFile(*sslKeyFileName, os.O_RDWR|os.O_CREATE, os.FileMode(0600)); err != nil {
+ fmt.Printf("Could not open the keyfile for writing: %v!\n", err)
+ sslKeyFileConcurrentWriter = nil
+ } else {
+ if err = utilities.SeekForAppend(sslKeyFileHandle); err != nil {
+ fmt.Printf("Could not seek to the end of the key file: %v!\n", err)
+ sslKeyFileConcurrentWriter = nil
+ } else {
+ if debug.IsDebug(debugLevel) {
+ fmt.Printf("Doing SSL key logging through file %v\n", *sslKeyFileName)
+ }
+ sslKeyFileConcurrentWriter = ccw.NewConcurrentFileWriter(sslKeyFileHandle)
+ defer sslKeyFileHandle.Close()
+ }
+ }
+ }
+
+ if err := config.Get(configHostPort, *configPath, sslKeyFileConcurrentWriter); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
return
}
@@ -180,26 +199,6 @@ func main() {
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
-
- var sslKeyFileConcurrentWriter *ccw.ConcurrentWriter = nil
- if *sslKeyFileName != "" {
- if sslKeyFileHandle, err := os.OpenFile(*sslKeyFileName, os.O_RDWR|os.O_CREATE, os.FileMode(0600)); err != nil {
- fmt.Printf("Could not open the keyfile for writing: %v!\n", err)
- sslKeyFileConcurrentWriter = nil
- } else {
- if err = utilities.SeekForAppend(sslKeyFileHandle); err != nil {
- fmt.Printf("Could not seek to the end of the key file: %v!\n", err)
- sslKeyFileConcurrentWriter = nil
- } else {
- if debug.IsDebug(debugLevel) {
- fmt.Printf("Doing SSL key logging through file %v\n", *sslKeyFileName)
- }
- sslKeyFileConcurrentWriter = ccw.NewConcurrentFileWriter(sslKeyFileHandle)
- defer sslKeyFileHandle.Close()
- }
- }
- }
-
var selfProbeDataLogger datalogger.DataLogger[rpm.ProbeDataPoint] = nil
var foreignProbeDataLogger datalogger.DataLogger[rpm.ProbeDataPoint] = nil
var downloadThroughputDataLogger datalogger.DataLogger[rpm.ThroughputDataPoint] = nil
@@ -309,25 +308,29 @@ func main() {
generate_lgd := func() lgc.LoadGeneratingConnection {
return &lgc.LoadGeneratingConnectionDownload{
Path: config.Urls.LargeUrl,
+ Host: config.Urls.LargeUrlHost,
KeyLogger: sslKeyFileConcurrentWriter,
}
}
generate_lgu := func() lgc.LoadGeneratingConnection {
return &lgc.LoadGeneratingConnectionUpload{
Path: config.Urls.UploadUrl,
+ Host: config.Urls.UploadUrlHost,
KeyLogger: sslKeyFileConcurrentWriter,
}
}
generateSelfProbeConfiguration := func() rpm.ProbeConfiguration {
return rpm.ProbeConfiguration{
- URL: config.Urls.SmallUrl,
+ URL: config.Urls.SmallUrl,
+ Host: config.Urls.SmallUrlHost,
}
}
generateForeignProbeConfiguration := func() rpm.ProbeConfiguration {
return rpm.ProbeConfiguration{
- URL: config.Urls.SmallUrl,
+ URL: config.Urls.SmallUrl,
+ Host: config.Urls.SmallUrlHost,
}
}