netxlite: consider bypassing net.Resolver completely #2118
Labels
bug
Something isn't working
enhancement
improving existing code or new feature
ooni/probe-engine
platform/android
priority/medium
user feedback
requests that have been added to the backlog as a direct result of user feedback or testing
This issue is about bypassing net.Resolver in
internal/netxlite
when compiled withCGO_ENABLED=0
(which is what one would get when cross compiling the code). The ooni/probe-cli#764 pull request is changing netxlite to bypassnet.Resolver
withCGO_ENABLED=1
in favor of callinggetaddrinfo
directly to fix #2029. This means that we will always have a working resolver when compiled withCGO_ENABLED=1
. What's more, we'll have the luxury of using the system resolver, which reportedly is the only reliable resolver in some very filtered networks (e.g., during partial shutdowns). OTOH, withCGO_ENABLED=0
, we are still usingnet.Resolver
in itsnetgo
flavor, which means reading/etc/resolv.conf
. Because there is no/etc/resolv.conf
on Android,miniooni
cross compiled for Android does not work in this scenario (this is already the case regardless of our changes to improvegetaddrinfo
). My proposal here is to fallback to an UDP resolver in this case rather than relying on using the one written by the Go time and included in the stdlib. Such a resolver would probably attempt to use/etc/resolv.conf
along with a set of hardcoded resolvers (e.g.,8.8.8.8:53/udp
) trying to provideCGO_ENABLED=0
users with a workable resolver. I'm flagging this issue as a user request because we received reports ofminiooni
not working on Android using Termux in Slack.The text was updated successfully, but these errors were encountered: