In torrc, I have come across both these lines:
HiddenServicePort 80 127.0.0.1:80
vs
HiddenServicePort 80 127.0.0.1:8080
Can anyone explain what their differences are?
Tor Stack Exchange is a question and answer site for researchers, developers, and users of Tor. It only takes a minute to sign up.
Sign up to join this communityThe only difference between 127.0.0.1:80
and 127.0.0.1:8080
is the exit port of you local web server, or also known as the listening port.
It is the port number your locally running web server, whether it be Apache, Nginx, etc, is open to incoming requests.
To find out which port your server is using, check the configuration file in the server's installation directory, or just use 80 if you haven't changed any defaults.
The first number is the port on which the HS accepts connections.
The address+port is the actual (web?) server that the HS connects to.
In your second example:
HiddenServicePort 80 127.0.0.1:8080
The web server listens to port 8080, but the HS accepts connections to port #80. (Which is the default for http, so clients don't have to specify a port number.)
In this case, Tor and the web server live on the same host, so Tor connects to 127.0.0.1 (localhost) but if they don't live on the same host, then the HiddenServicePort
directive should have the address (and port) of the web server.