This commit is contained in:
Simon Zolin 2020-05-29 11:46:37 +03:00
parent 78648649fe
commit bccb939346
4 changed files with 9 additions and 4 deletions

View File

@ -1276,7 +1276,7 @@ Response:
"upstream":"...", // Upstream URL starting with tcp://, tls://, https://, or with an IP address "upstream":"...", // Upstream URL starting with tcp://, tls://, https://, or with an IP address
"answer_dnssec": true, "answer_dnssec": true,
"client":"127.0.0.1", "client":"127.0.0.1",
"client_proto": "" (plain) | "doh", "client_proto": "" (plain) | "doh" | "dot",
"elapsedMs":"0.098403", "elapsedMs":"0.098403",
"filterId":1, "filterId":1,
"question":{ "question":{

View File

@ -40,8 +40,10 @@ func processQueryLogsAndStats(ctx *dnsContext) int {
ClientIP: getIP(d.Addr), ClientIP: getIP(d.Addr),
} }
if d.HTTPRequest != nil { if d.Proto == "https" {
p.ClientProto = "doh" p.ClientProto = "doh"
} else if d.Proto == "tls" {
p.ClientProto = "dot"
} }
if d.Upstream != nil { if d.Upstream != nil {

View File

@ -1422,7 +1422,10 @@ components:
type: string type: string
example: 192.168.0.1 example: 192.168.0.1
client_proto: client_proto:
type: string enum:
- dot
- doh
- ""
elapsedMs: elapsedMs:
type: string type: string
example: "54.023928" example: "54.023928"

View File

@ -48,7 +48,7 @@ type AddParams struct {
Elapsed time.Duration // Time spent for processing the request Elapsed time.Duration // Time spent for processing the request
ClientIP net.IP ClientIP net.IP
Upstream string // Upstream server URL 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 // New - create a new instance of the query log