diff --git a/AGHTechDoc.md b/AGHTechDoc.md index e5f120d7..cc20d60a 100644 --- a/AGHTechDoc.md +++ b/AGHTechDoc.md @@ -1276,7 +1276,7 @@ Response: "upstream":"...", // Upstream URL starting with tcp://, tls://, https://, or with an IP address "answer_dnssec": true, "client":"127.0.0.1", - "client_proto": "" (plain) | "doh", + "client_proto": "" (plain) | "doh" | "dot", "elapsedMs":"0.098403", "filterId":1, "question":{ diff --git a/dnsforward/stats.go b/dnsforward/stats.go index 3f3ee10c..231ead78 100644 --- a/dnsforward/stats.go +++ b/dnsforward/stats.go @@ -40,8 +40,10 @@ func processQueryLogsAndStats(ctx *dnsContext) int { ClientIP: getIP(d.Addr), } - if d.HTTPRequest != nil { + if d.Proto == "https" { p.ClientProto = "doh" + } else if d.Proto == "tls" { + p.ClientProto = "dot" } if d.Upstream != nil { diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 94eb6717..858ae735 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1422,7 +1422,10 @@ components: type: string example: 192.168.0.1 client_proto: - type: string + enum: + - dot + - doh + - "" elapsedMs: type: string example: "54.023928" diff --git a/querylog/querylog.go b/querylog/querylog.go index 5431ef1e..7f6b4c87 100644 --- a/querylog/querylog.go +++ b/querylog/querylog.go @@ -48,7 +48,7 @@ type AddParams struct { Elapsed time.Duration // Time spent for processing the request ClientIP net.IP Upstream string // Upstream server URL - ClientProto string // Protocol for the client connection: "" (plain), "doh" + ClientProto string // Protocol for the client connection: "" (plain), "doh", "dot" } // New - create a new instance of the query log