Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability for wgsd-client to work over tcp via optional protocol flag #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/wgsd-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
3 changes: 3 additions & 0 deletions cmd/wgsd-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 {
Expand Down