mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
all: add router client info detection
This commit add the ability for ctrld to gather client information, including mac/ip/hostname, and send to Control-D server through a config per upstream. - Add send_client_info upstream config. - Read/Watch dnsmasq leases files on supported platforms. - Add corresponding client info to DoH query header All of these only apply for Control-D upstream, though.
This commit is contained in:
committed by
Cuong Manh Le
parent
d52cd11322
commit
0645a738ad
@@ -147,6 +147,28 @@ func TestUpstreamConfig_Init(t *testing.T) {
|
||||
Timeout: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"doh+doh3 with send client info set",
|
||||
&UpstreamConfig{
|
||||
Name: "doh",
|
||||
Type: "doh",
|
||||
Endpoint: "https://example.com?k=v",
|
||||
BootstrapIP: "",
|
||||
Domain: "",
|
||||
Timeout: 0,
|
||||
SendClientInfo: ptrBool(false),
|
||||
},
|
||||
&UpstreamConfig{
|
||||
Name: "doh",
|
||||
Type: "doh",
|
||||
Endpoint: "https://example.com?k=v",
|
||||
BootstrapIP: "",
|
||||
Domain: "example.com",
|
||||
Timeout: 0,
|
||||
SendClientInfo: ptrBool(false),
|
||||
u: u2,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
@@ -158,3 +180,7 @@ func TestUpstreamConfig_Init(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func ptrBool(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user