-
Wrap sockets to use the SOCKS proxy provided by Tor
-
Wrap sockets to connect to Onion Services
-
Authenticates against a local Tor daemon to create / list / delete traditional and ephemeral Onion Services
-
Tested on Linux
-
Basic functional tests
Install the library:
nimble install tor
Usage:
import tor
# connect over Tor
var s = newProxySocket()
s.connect("1.1.1.1", 80.Port)
s.send("GET / HTTP/1.1\nHost: facebook.com\n\n")
discard s.recvLine(timeout=9000)
echo s.recv(200)
# connet to Onion Service
s = newProxySocket()
s.connect("facebookcorewwwi.onion", 80.Port)
s.send("GET / HTTP/1.1\nHost: facebook.com\n\n")
echo s.recvLine(timeout=9000)
See the tests/ dir for more usage examples.
See tests/serve_file_demo.nim for a HTTP-based onion service demo
To enable authentication with the Controller, install the libsodium wrapper and pass -d:usesodium