Last active
December 20, 2015 04:29
-
-
Save Karunamon/6070929 to your computer and use it in GitHub Desktop.
Mac Homebrew formula for Tsocks. No idea why this is unavailable where it's supposed to be...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Tsocks < Formula | |
# The original is http://tsocks.sourceforge.net/ | |
# This GitHub repo is a maintained fork with OSX support | |
homepage 'http://github.com/pc/tsocks' | |
head 'https://github.com/pc/tsocks.git' | |
depends_on 'autoconf' => :build if MacOS.xcode_version.to_f >= 4.3 | |
def install | |
system "autoconf", "-v" | |
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--with-conf=#{config_file}" | |
inreplace("tsocks") { |bin| bin.change_make_var! "LIBDIR", lib } | |
system "make" | |
system "make install" | |
etc.install "tsocks.conf.simple.example" => "tsocks.conf" unless config_file.exist? | |
end | |
def test | |
puts 'Your current public ip is:' | |
ohai `curl -sS ifconfig.me 2>&1`.chomp | |
puts "If your correctly configured #{config_file}, this should show the ip you have trough the proxy" | |
puts 'Your ip through the proxy is:' | |
ohai `tsocks curl -sS ifconfig.me 2>&1`.chomp | |
end | |
def config_file | |
etc / 'tsocks.conf' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment