Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dryruby/tor.rb
Tor.rb is a Ruby library for interacting with the Tor anonymity network.
https://github.com/dryruby/tor.rb
ruby rubygems tor
Last synced: 6 days ago
JSON representation
Tor.rb is a Ruby library for interacting with the Tor anonymity network.
- Host: GitHub
- URL: https://github.com/dryruby/tor.rb
- Owner: dryruby
- License: unlicense
- Created: 2010-08-01T00:20:58.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2024-07-07T20:39:35.000Z (4 months ago)
- Last Synced: 2024-10-03T13:49:13.700Z (about 1 month ago)
- Topics: ruby, rubygems, tor
- Language: Ruby
- Homepage: https://rubygems.org/gems/tor
- Size: 50.8 KB
- Stars: 116
- Watchers: 8
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Authors: AUTHORS
Awesome Lists containing this project
- awesome-tor - tor.rb - This is a Ruby library for interacting with the Tor anonymity network. (Applications / Other applications)
- awesome-tor - tor.rb - Ruby library for interacting with the Tor anonymity network. (Uncategorized / Uncategorized)
- awesome-network-stuff - **104**星
README
Tor.rb: Onion Routing for Ruby
==============================This is a Ruby library for interacting with the [Tor][] anonymity network.
*
Features
--------* Supports checking whether Tor is installed in the user's current `PATH`,
and if it is, returning the version number.
* Supports parsing Tor configuration files and looking up the values of
particular options.
* Supports querying and controlling a locally-running Tor process using the
[Tor Control Protocol (TC)][TC] over a socket connection.
* Supports querying the [Tor DNS Exit List (DNSEL)][TorDNSEL] to determine
whether a particular host is a Tor exit node or not.
* Compatible with Ruby 1.8.7+, Ruby 1.9.x, and JRuby 1.4/1.5.Examples
--------require 'rubygems'
require 'tor'### Checking whether Tor is installed and which version it is
Tor.available? #=> true
Tor.version #=> "0.2.1.25"### Parsing the Tor configuration file (1)
torrc = Tor::Config.load("/etc/tor/torrc")
### Parsing the Tor configuration file (2)
Tor::Config.open("/etc/tor/torrc") do |torrc|
puts "Tor SOCKS port: #{torrc['SOCKSPort']}"
puts "Tor control port: #{torrc['ControlPort']}"
puts "Tor exit policy:"
torrc.each('ExitPolicy') do |key, value|
puts " #{value}"
end
end### Communicating with a running Tor process
Tor::Controller.connect(:port => 9051) do |tor|
puts "Tor version: #{tor.version}"
puts "Tor config file: #{tor.config_file}"
end### Checking whether a particular host is a Tor exit node
Tor::DNSEL.include?("185.220.101.21") #=> true
Tor::DNSEL.include?("1.2.3.4") #=> falseDependencies
------------* [Ruby](http://ruby-lang.org/) (>= 1.8.7) or (>= 1.8.1 with [Backports][])
* [Tor](https://www.torproject.org/download.html.en) (>= 0.2.1)Installation
------------The recommended installation method is via [RubyGems](http://rubygems.org/).
To install the latest official release of Tor.rb, do:% [sudo] gem install tor # Ruby 1.8.7+ or 1.9.x
% [sudo] gem install backports tor # Ruby 1.8.1+Download
--------To get a local working copy of the development repository, do:
% git clone git://github.com/bendiken/tor-ruby.git
Alternatively, you can download the latest development version as a tarball
as follows:% wget http://github.com/bendiken/tor-ruby/tarball/master
Author
------* [Arto Bendiken](mailto:[email protected]) -
Maintenance
-----------* [Łukasz Wieczorek](mailto:[email protected]) -
License
-------Tor.rb is free and unencumbered public domain software. For more
information, see or the accompanying UNLICENSE file.[Tor]: https://www.torproject.org/
[TorDNSEL]: https://www.torproject.org/tordnsel/
[TC]: http://gitweb.torproject.org/tor.git?a=blob_plain;hb=HEAD;f=doc/spec/control-spec.txt
[OR]: http://en.wikipedia.org/wiki/Onion_routing
[Backports]: http://rubygems.org/gems/backports