add compression flag option for http request

This commit is contained in:
ginuerzh
2024-11-02 20:41:23 +08:00
parent edb9a992e2
commit a12870e766
6 changed files with 23 additions and 11 deletions
+3 -4
View File
@@ -22,6 +22,7 @@ const (
type metadata struct {
readTimeout time.Duration
keepalive bool
compression bool
probeResistance *probeResistance
enableUDP bool
header http.Header
@@ -55,10 +56,8 @@ func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
h.md.header = hd
}
h.md.keepalive = true
if mdutil.IsExists(md, "http.keepalive", "keepalive") {
h.md.keepalive = mdutil.GetBool(md, "http.keepalive", "keepalive")
}
h.md.keepalive = mdutil.GetBool(md, "http.keepalive", "keepalive")
h.md.compression = mdutil.GetBool(md, "http.compression", "compression")
if pr := mdutil.GetString(md, "probeResist", "probe_resist"); pr != "" {
if ss := strings.SplitN(pr, ":", 2); len(ss) == 2 {