tor

Tor helper library


Keywords
library, security, crypto, tor, onion, nim, nim-lang, onion-service, proxy, socks, tor-onion-service
License
LGPL-3.0
Install
nimble install tor

Documentation

Tor helper for Nim

badge tags License

Features

  • 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

Usage

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 / \n")
discard s.recvLine(timeout=3000)
discard s.recv(200)

# connet to Onion Service
s = newProxySocket()
s.connect("facebookcorewwwi.onion", 80.Port)
s.send("GET / \n")
discard s.recvLine(timeout=3000)

See the tests/ dir for more usage examples.

To enable authentication with the Controller, install the libsodium wrapper and pass -d:usesodium

Contributing

Testing and PRs are welcome.