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
Hi,
I have previously used this codebase to start up ephemeral onion services with no issues, however I encountered an issue when using it to start a persistent onion service. In my torrc I have configured HiddenServicePort in the usual way; 80 for the public port, and a specific chosen port is entered (say 8080) for the local port.
When I ran a test using the example code, but setting my endpoint string like this:
# XXX - perhaps allow the user to pass in an endpoint
# descriptor and make this one the default? Then would
# probably want to check for "is a local interface or not" and
# at *least* warn if it's not local...
self.tcp_endpoint=serverFromString(
self._reactor,
'tcp:0:interface=127.0.0.1',
)
The variable self.local_port was set in the constructor as intended (here, to 8080) but the string used in the serverFromString call just puts 0 so we get a fresh port. I verified that this could be fixed with something like:
if self.local_port is None:
serverstring = 'tcp:0:interface=127.0.0.1'
else:
serverstring = 'tcp:{}:interface=127.0.0.1'.format(self.local_port)
self.tcp_endpoint = serverFromString(
self._reactor,
serverstring,
)
... not that that is more than a testing patch, but just to concretize the point. It works fine after that (i.e. the hidden service is accessible).
The text was updated successfully, but these errors were encountered:
Hi,
I have previously used this codebase to start up ephemeral onion services with no issues, however I encountered an issue when using it to start a persistent onion service. In my
torrc
I have configuredHiddenServicePort
in the usual way; 80 for the public port, and a specific chosen port is entered (say 8080) for the local port.When I ran a test using the example code, but setting my endpoint string like this:
... I found that the local port is generated randomly, rather than being 8080. In the code for
TCPHiddenServiceEndpoint.listen()
it's clear why:txtorcon/txtorcon/endpoints.py
Lines 562 to 569 in 0c416cc
The variable
self.local_port
was set in the constructor as intended (here, to 8080) but the string used in theserverFromString
call just puts 0 so we get a fresh port. I verified that this could be fixed with something like:... not that that is more than a testing patch, but just to concretize the point. It works fine after that (i.e. the hidden service is accessible).
The text was updated successfully, but these errors were encountered: