From 8ed190f81a00d91979d69d1659165d939df5439e Mon Sep 17 00:00:00 2001 From: Francis Mendoza Date: Fri, 15 Nov 2024 20:29:56 -0800 Subject: [PATCH 1/2] Added ability to query over tcp via optional protocol flag --- cmd/wgsd-client/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/wgsd-client/main.go b/cmd/wgsd-client/main.go index 27e5f4a..16cbdd7 100644 --- a/cmd/wgsd-client/main.go +++ b/cmd/wgsd-client/main.go @@ -24,6 +24,8 @@ var ( dnsServerFlag = flag.String("dns", "", "ip:port of DNS server") dnsZoneFlag = flag.String("zone", "", "dns zone name") + // Adding optional protocol flag to specify protocol to use + protocolFlag = flag.String("protocol", "", "optional: tcp or udp (default)") ) func main() { @@ -63,6 +65,7 @@ func main() { defer close(done) dnsClient := &dns.Client{ Timeout: time.Second * 5, + Net: *protocolFlag, // Inserting string value of protocol flag if present to indicate udp, tcp, etc. } for _, peer := range wgDevice.Peers { select { From a52130f5de77731108d4ec58e44d3ae70f61989d Mon Sep 17 00:00:00 2001 From: Francis Mendoza Date: Fri, 15 Nov 2024 20:31:30 -0800 Subject: [PATCH 2/2] Updated Readme.md for wgsd-client documenting protocol flag usage --- cmd/wgsd-client/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/wgsd-client/README.md b/cmd/wgsd-client/README.md index 6d4f718..b44b9f0 100644 --- a/cmd/wgsd-client/README.md +++ b/cmd/wgsd-client/README.md @@ -10,4 +10,6 @@ Usage of ./wgsd-client: ip:port of DNS server -zone string dns zone name + -protocol string (optional) + udp (default) or tcp ``` \ No newline at end of file