How to create onion mirror links? This section of the file consists of groups of lines, each representing one onion service. Right now they are all commented out (the lines start with #), so onion services are disabled. Each group of lines consists of one HiddenServiceDir line, and one or more HiddenServicePort lines:
- HiddenServiceDir is a directory where Tor will store information about that onion service. In particular, Tor will create a file here named hostname which will tell you the onion URL. You don’t need to add any files to this directory. Make sure this is not the same directory as the hidserv directory you created when setting up thttpd, as your HiddenServiceDir contains secret information!
- HiddenServicePort lets you specify a virtual port (that is, what port people accessing the onion service will think they’re using) and an IP address and port for redirecting connections to this virtual port.
Add the following lines to your torrc:
HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/ HiddenServicePort 80 127.0.0.1:8080
You’re going to want to change the HiddenServiceDir line, so it points to an actual directory that is readable/writeable by the user that will be running Tor. The above line should work if you’re using the OS X Tor package. On Unix, try “/home/username/hidden_service/” and fill in your own username in place of “username”. On Windows you might pick:
HiddenServiceDir C:\Users\username\Documents\tor\hidden_service HiddenServicePort 80 127.0.0.1:8080
Note that since 0.2.6, both SocksPort and HiddenServicePort support Unix sockets. This means that you can point the HiddenServicePort to a Unix socket:
HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/ HiddenServicePort 80 unix:/path/to/socket