You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Rack::DetectTor determines whether a user is connecting via a Tor exit
relay. It adds an environment variable tor_exit_user to the
request.env object with a value of true or false.
Usage
Add the gem to your Gemfile:
gem'rack-detect-tor'
and add it to your middleware stack. In config.ru:
It is recommended to provide external_ip and external_port (see
below). update_frequency is how often Rack::DetectTor will update its
list of Tor exits. It defaults to one hour (3600 seconds).
Note on external_ip and external_port
You are not required to provide these. However:
It's important to provide the external_ip and external_port values,
corresponding with the external IP and port of your web server. Many Tor
relays are configured not to allow connections on port 80/443/etc. If you
don't provide or are unable to provide the external IP of your web server,
the value added to request.env['tor_exit_user'] will tell you only that
the IP corresponds with A Tor exit, not necessarily one that is
configured to relay connections to your website.