this post was submitted on 05 Aug 2024
24 points (92.9% liked)
Tor - The Onion Router
1465 readers
1 users here now
Tips, tricks and information about the Tor network!
founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's easy. Just edit your Tor configuration file (torrc) to enable an onion service. This one forwards from the onion service on port 80 (so users don't have to specify a port number in the URL) to a local HTTP server running on your machine on port 8000:
Change the directory path based on your operating system. Specify a directory that doesn't exist yet so Tor can set the correct permissions on it. Next, start or restart Tor. Then just read the onion service's hostname in the
hostname
file created in that hidden services directory.You can then run any HTTP server on localhost:8000 and anyone connecting to your onion service can access it. In Python this might be as simple as
python3 -m http.server --bind localhost 8000 --directory .
to share the files current directory (but be aware that there are some security considerations, like symbolic links, to be aware of. Just use this for testing.) For production servers you will want a "real" http server.