GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dryruby/tor.rb: Tor.rb is a Ruby library for interacting with the Tor anonymity network.

BranchesTags
Open more actions menu

Latest commit

 

History

56 Commits
56 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
doc
doc
 
 
lib
lib
 
 
spec
spec
 
 
.gemspec
.gemspec
 
 
.gitignore
.gitignore
 
 
.yardopts
.yardopts
 
 
AUTHORS
AUTHORS
 
 
CREDITS
CREDITS
 
 
Gemfile
Gemfile
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
UNLICENSE
UNLICENSE
 
 
VERSION
VERSION
 
 
tor.gemspec
tor.gemspec
 
 

Repository files navigation

Tor.rb: Onion Routing for Ruby

This is a Ruby library for interacting with the Tor anonymity network.

  • http://github.com/bendiken/tor-ruby

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) over a socket connection.
  • Supports querying the Tor DNS Exit List (DNSEL) 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")                     #=> false

Dependencies

  • Ruby (>= 1.8.7) or (>= 1.8.1 with Backports)
  • Tor (>= 0.2.1)

Installation

The recommended installation method is via RubyGems. 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 - https://ar.to

Maintenance

  • Łukasz Wieczorek - https://soiree.tech

License

Tor.rb is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

About

Tor.rb is a Ruby library for interacting with the Tor anonymity network.

rubygems.org/gems/tor

Topics

rubyrubygemstor

Resources

Readme
Unlicense

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

115 stars

Watchers

7 watching

Forks

22 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.