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 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 {