Coder Social home page Coder Social logo

mayeaux / tor-guard Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 20 KB

:heavy_check_mark: Identify IPs coming through the Tor network.

Home Page: https://rubygems.org/gems/tor-guard/versions/1.0.1

License: GNU General Public License v3.0

Ruby 100.00%

tor-guard's Introduction

Tor Guard Gem Version

Easily identify IPs coming through the Tor network.

Installation

$ gem install tor-guard

Usage

The gem can either be used as an executable (tg) or required and used as a library.

  1. You can give the executable an IP address and it will respond with true or false
$ tg 108.56.199.13

Note, the executable will return a successful status code if the IP address is an exit node. If it's not an exit node then the executable will return a non successful exit node. This can be leveraged when scripting, for example:

$ tg 108.56.199.13 && echo "Yep, it's an exit node"
  1. You can require the library and check within your own code.
require 'tor-guard'

if TorGuard.exit_node?('108.56.199.13')
    puts "Yep, it's an exit node!"
end

The library can tweak the refresh interval. By default, the library will refresh the internal list of exit nodes every 15 minutes. You can make the interval shorter or longer by providing the desired number of seconds:

TorGuard.configure do |config|
    config.refresh_interval = 60 # one minute
end

License

See the LICENSE file.

tor-guard's People

Contributors

prophittcorey avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.