Read Sean

Read me, read Sean.
posts - 508, comments - 655, trackbacks - 9, articles - 4

Mac安装tsocks

Posted on 2014-05-07 23:23 laogao 阅读(4056) 评论(2)  编辑  收藏 所属分类: Computer Usage
不知道从什么时候开始的,tsocks在Mac下面安装要费些周折,brew官方和曾经一度存在的第三方tap都不再支持直接brew install,需要手工创建formula。过程倒也还OK:

vim /usr/local/Library/Formula/tsocks.rb

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

有了上述formula之后,即可 brew install --HEAD tsocks 。

Feedback

# re: Mac安装tsocks  回复  更多评论   

2014-05-11 21:23 by ayanamist
有一个proxychains-ng项目,还在更新,可以试试的

# re: Mac安装tsocks  回复  更多评论   

2014-07-17 20:40 by mzj
安装不上

brew install --HEAD tsocks 1 ↵
==> Cloning https://github.com/pc/tsocks.git
Updating /Library/Caches/Homebrew/tsocks--git
==> autoconf -v
==> ./configure --prefix=/usr/local/Cellar/tsocks/HEAD --with-conf=/usr/local/etc/tsocks.conf
==> make
==> make install
mkdir /usr/local/Cellar/tsocks/HEAD/share/man/man8
/usr/bin/install -c -m 644 tsocks.8 /usr/local/Cellar/tsocks/HEAD/share/man/man8/
/bin/sh mkinstalldirs "/usr/local/Cellar/tsocks/HEAD/share/man/man5"
mkdir /usr/local/Cellar/tsocks/HEAD/share/man/man5
/usr/bin/install -c -m 644 tsocks.conf.5 /usr/local/Cellar/tsocks/HEAD/share/man/man5/

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

求指教。

只有注册用户登录后才能发表评论。


网站导航: