mirror of
https://github.com/jwhited/wgsd.git
synced 2025-04-04 11:09:31 +08:00
Merge a52130f5de77731108d4ec58e44d3ae70f61989d into 537afbe95b2019ac8c32e700bd6d7dc2929e3187
This commit is contained in:
commit
0e6f8797bf
@ -10,4 +10,6 @@ Usage of ./wgsd-client:
|
|||||||
ip:port of DNS server
|
ip:port of DNS server
|
||||||
-zone string
|
-zone string
|
||||||
dns zone name
|
dns zone name
|
||||||
|
-protocol string (optional)
|
||||||
|
udp (default) or tcp
|
||||||
```
|
```
|
@ -24,6 +24,8 @@ var (
|
|||||||
dnsServerFlag = flag.String("dns", "",
|
dnsServerFlag = flag.String("dns", "",
|
||||||
"ip:port of DNS server")
|
"ip:port of DNS server")
|
||||||
dnsZoneFlag = flag.String("zone", "", "dns zone name")
|
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() {
|
func main() {
|
||||||
@ -63,6 +65,7 @@ func main() {
|
|||||||
defer close(done)
|
defer close(done)
|
||||||
dnsClient := &dns.Client{
|
dnsClient := &dns.Client{
|
||||||
Timeout: time.Second * 5,
|
Timeout: time.Second * 5,
|
||||||
|
Net: *protocolFlag, // Inserting string value of protocol flag if present to indicate udp, tcp, etc.
|
||||||
}
|
}
|
||||||
for _, peer := range wgDevice.Peers {
|
for _, peer := range wgDevice.Peers {
|
||||||
select {
|
select {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user