programs for edns, svcb, https support measurement

This commit is contained in:
MDK
2024-03-25 17:15:25 +08:00
commit 7115311c42
10 changed files with 517 additions and 0 deletions

31
utils/other_utils.go Normal file
View File

@@ -0,0 +1,31 @@
package utils
import (
"bufio"
_ "encoding/json"
_ "fmt"
"io"
_ "net"
_ "net/http"
"os"
_ "strconv"
"strings"
)
func RetrieveLines(pool chan string, filename string) {
f, err := os.Open(filename)
if err != nil {
panic(err)
}
//fmt.Println("reading file ...")
reader := bufio.NewReader(f)
for {
s, err := reader.ReadString('\n')
if err == io.EOF {
break
}
s = strings.Trim(s, "\n")
pool <- s
}
close(pool)
}