guardianproject / orbot-apple

Orbot VPN app for iOS
MIT License
205 stars 34 forks source link

Compile exit node country list #41

Closed tladesignz closed 1 year ago

tladesignz commented 1 year ago

Finally found out how Orbot Android creates that list of countries for exit nodes and my worst ideas were not disappointed:

https://github.com/guardianproject/orbot/blob/master/app/src/main/java/org/torproject/android/ExitNodeDialogFragment.kt#L60-L84

It's static.

I tried really hard to come up with a better solution. Result is, I optimized memory consumption and processing time for Tor controller responses in Tor.framework heavily:

https://github.com/iCepa/Tor.framework/commit/0e9fa793eb4b60e76a82f2d05fb6d973c5b8136b https://github.com/iCepa/Tor.framework/commit/519060203fb6e37f6f1532e0d745d43109a5ca10

...but still need ~15 seconds to compile a list of exit nodes and resolve their countries, since there seems to be no way to have Tor filter the full node list first.

That's not good.

@n8fr8, is there really nothing better than a static list?

n8fr8 commented 1 year ago

Let's make a build script that hits this API: https://metrics.torproject.org/onionoo.html#examples

and generates a static asset.

tladesignz commented 1 year ago

Implemented with 1da5a62e708710536494b474b431c0eee974a2a9