You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There isn't an option on the Resolver classes for that at present, no, though it'd be easy enough to add an argument to the Resolver.lookup method to force the use of TCP; in fact, I just checked in some code that does just that — see 7434579. Let me know if it works for you.
I've forked the repo and have a working solution to this. Basically I've implemented the same changes as your commit but also had to implement the eof_received function in DNSProtocol for TCP communication. One other issue I had to tackle for AWS Lambda is that ipv6 is not allowed. To fix this, I have used self.prefer_ipv6 to determine if we should attempt to convert the server address to ipv6 or leave as ipv4.
ifself.prefer_ipv6and (isinstance(self.server[0], ipaddress.IPv4Address)
or (isinstance(self.server[0], str)
and_ipv4_re.match(self.server[0]))):
self.server= ('::ffff:'+str(self.server[0]), self.server[1])
I can open a PR if you are interested in incorporating these changes. Let me know if using prefer_ipv6 in that way is appropriate or if we should force ipv4 in another way.
Hi, I'm looking to use this library in AWS Lambda which does not allow UDP sockets. Is there a way we can force TCP protocol to be used? Thanks.
The text was updated successfully, but these errors were encountered: