Skip to content

Commit

Permalink
fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej.benkovsky committed Oct 27, 2024
1 parent 6e1532e commit 28c72ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ go get github.com/tantalor93/doh-go

## Examples
```
// create client with default settings
// create client with default settings resolving via CloudFlare DoH Server
c := doh.NewClient("https://1.1.1.1/dns-query")
// prepare payload
msg := dns.Msg{}
msg.SetQuestion("google.com.", dns.TypeA)
// send DNS query to Cloudflare Server over DoH using POST method
// send DNS query using HTTP POST method
r, err := c.SendViaPost(context.Background(), &msg)
if err != nil {
panic(err)
Expand All @@ -35,8 +35,8 @@ if err != nil {
// do something with response
fmt.Println(dns.RcodeToString[r.Rcode])
// send DNS query to Cloudflare Server over DoH using GET method
r, err = c.SendViaGet(context.Background(), "https://1.1.1.1/dns-query", &msg)
// send DNS query using HTTP GET method
r, err = c.SendViaGet(context.Background(), &msg)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 28c72ae

Please sign in to comment.