Opened 3 months ago

Last modified 3 months ago

#30551 new defect

Android - Use different port numbers

Reported by: sysrqb Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile
Cc: sisbell Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

In #29757 we looked at one issue preventing side-by-side installation of Tor Browser on Android. The next issue is running multiple versions at the same time. Tor is started with some hard-coded port numbers (see for example) in Tor Browser stable and alpha, and this prevents bootstrapping on the second instance (because tor can't bind on those sockets). We should allow running stable and alpha at the same time by choosing different port numbers for them.

Specifically, we should look at TransPort (9140) and HTTPTunnelPort (8218). Currently, we don't need either of these. (We also don't need the DNSPort on 5400).

I also wonder why/how the app works if the SocksPort is selected randomly.

Child Tickets

Change History (4)

comment:1 Changed 3 months ago by sisbell

These values are the ones defined by Orbot but we can override them for torbrowser.

We can extend AndroidTorSettings (say BrowserTorSettings) and override transPort(), getHttpTunnelPort(), dnsPort() to all return null. This will remove them from the generated torrc file so there will not be any conflict.

Then in TorService.onCreate(), we detect if the package name is torbrowser and if so use BrowserTorSettings rather than AndroidSettings.

comment:2 in reply to:  1 ; Changed 3 months ago by sysrqb

Replying to sisbell:

These values are the ones defined by Orbot but we can override them for torbrowser.

We can extend AndroidTorSettings (say BrowserTorSettings) and override transPort(), getHttpTunnelPort(), dnsPort() to all return null. This will remove them from the generated torrc file so there will not be any conflict.

Then in TorService.onCreate(), we detect if the package name is torbrowser and if so use BrowserTorSettings rather than AndroidSettings.

Hmmm, okay, I'll look into this. Thanks! We'll be sad if we must special case it based on package name (we have three different packages right now, torbrowser, torbrowser_alpha, torbrowser_nightly). And other apps may want this capability too.

comment:3 in reply to:  2 Changed 3 months ago by sisbell

Replying to sysrqb:

Replying to sisbell:

These values are the ones defined by Orbot but we can override them for torbrowser.

We can extend AndroidTorSettings (say BrowserTorSettings) and override transPort(), getHttpTunnelPort(), dnsPort() to all return null. This will remove them from the generated torrc file so there will not be any conflict.

Then in TorService.onCreate(), we detect if the package name is torbrowser and if so use BrowserTorSettings rather than AndroidSettings.

Hmmm, okay, I'll look into this. Thanks! We'll be sad if we must special case it based on package name (we have three different packages right now, torbrowser, torbrowser_alpha, torbrowser_nightly). And other apps may want this capability too.

We can always remove the default values used in AndroidTorSettings. That way if the app doesn't explicitly set them, they won't be added the torrc file. We'd just need to make sure that apps like Orbot set default preferences explicitly on startup.

comment:4 Changed 3 months ago by gk

FWIW: the-same-port-numbers-across-different-tor-browser-series is not only a mobile issue, it's affecting desktop as well: #28810.

Note: See TracTickets for help on using tickets.