likexian / whois

Whois client for domain and ip whois information query in Go(Golang).
Apache License 2.0
401 stars 75 forks source link

Timeout Setting Ignored in Whois Client #37

Open whydee86 opened 1 year ago

whydee86 commented 1 year ago

Issue Description

The Whois client doesn't seem to respect the timeout settings when making queries. Despite setting the timeout via SetTimeout(), the client operation doesn't timeout as expected.

Steps to Reproduce

  1. Import the Whois client.
  2. Set the timeout using SetTimeout() method.
  3. Make a Whois query.
client := whois.NewClient()
client.SetDialer(proxy.FromEnvironment())
client.SetTimeout(5 * time.Second)
output, err := client.Whois("example.com", *server)

Expected Behavior

The query should timeout after 5 seconds if the server does not respond.

Actual Behavior

The operation does not timeout even after 5 seconds.

Additional Information

likexian commented 6 months ago

Hello @whydee86 I have try and can not reproduce it.

And we do have a testing case to make sure it works, please refer to: https://github.com/likexian/whois/blob/master/whois_test.go#L117


If you think this repository is helpful, please share it with friends, thanks.

likexian commented 5 months ago

Hello @whydee86 Sorry, there is really an issue, the timeout of dailer is not updated. I will try to fixed it.


If you think this repository is helpful, please share it with friends, thanks.