add option for declaring the result of querying the socks proxy port via control port
Summary
I'm using tor in a container within a docker-compose application and thus have the Socks port bound to all interfaces:
SocksPort 0.0.0.0:9050
SocksPort [::]:9050
I'm also using a control port (config not shown here) to have hidden services managed by applications, more specifically bitcoind.
The application queries via control port for the socks proxy port and arbitrary gets the last entry from the above list as result. This is already weird, why the last entry and not the first? To make matters worse, both entries are entirely wrong from the perspective of the application container, because it resolves to local addresses. If the application then tries to connect the socky proxy, it will fail.
To work around this problem, I replaced my declarations with this one
SocksPort tor:9050
"tor" being the hostname of my tor container. This works, but now the tor proxy is only listening on its external interface and only on one of the protocol families IPv4 or IPv6 (again, not clear which). This is undesired mainly because I want the socks proxy listening on both IPv4 and IPv6, and also on all interfaces. Note I can't use numerical IP addresses here, because Docker changes them around for each fresh container.
Feature request:
So my feature request would be a new (optional) configuration entry to declare the result of the query for socks proxy port via control port explicitly and independant of the binding declaration. And maybe a warning message if wildcard SocksPorts are used and the new configuration option is not present. Something like
SocksPort 0.0.0.0:9050
SocksPort [::]:9050
SocksPortQueryResult tor:9050
should do. Feel free to come up with a better option name.