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

custom server query returns error #11

Closed
jameswang2015 opened this issue Oct 19, 2019 · 0 comments
Closed

custom server query returns error #11

jameswang2015 opened this issue Oct 19, 2019 · 0 comments

Comments

@jameswang2015
Copy link

This is exactly what I want but when I try using custom service url https://rdap.markmonitor.com/rdap to respond to domain query for google.com, I get error No RDAP servers responded successfully (tried 1 server(s)). Here is my code:

func CustomUsage() {
	// Advanced usage:
	//
	// This demonstrates custom FetchRoles, a custom Context, a custom HTTP client,
	// a custom Bootstrapper, and a custom timeout.
	//   // Nameserver query on rdap.nic.cz.
	server, _ := url.Parse("https://rdap.markmonitor.com/rdap")
	  req := &rdap.Request{
		Type: rdap.DomainRequest,
		Query: "google.com",
		//FetchRoles: []string{"all"},
		//Timeout: time.Second * 45, // Custom timeout.

		Server: server,
	  }

	//fmt.Println(req.URL())

	  //req = req.WithContext(context.Context) // Custom context (see https://blog.golang.org/context).

	  client := &rdap.Client{}
	  //client.HTTP = &http.Client{} // Custom HTTP client.
	  //client.Bootstrap = &bootstrap.Client{} // Custom bootstapper.

	  resp, err := client.Do(req)
	  if err != nil {
	  	fmt.Println(err.Error())
	  }

	  if ns, ok := resp.Object.(*rdap.Domain); ok {
	   fmt.Printf("Handle=%s Domain=%s\n", ns.Handle, ns.LDHName)
	  }
}

Thanks

@skip2 skip2 closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants