Read Sean

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

          2014年5月7日

          不知道從什么時候開始的,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 。

          posted @ 2014-05-07 23:23 laogao 閱讀(4098) | 評論 (2)編輯 收藏

          主站蜘蛛池模板: 进贤县| 清水县| 南投市| 盐山县| 嘉峪关市| 于都县| 凤冈县| 甘谷县| 前郭尔| 广饶县| 大新县| 芦山县| 涪陵区| 广汉市| 武隆县| 全州县| 淳安县| 缙云县| 云浮市| 衢州市| 察哈| 宜宾市| 洛南县| 武邑县| 三穗县| 团风县| 凌海市| 弥渡县| 鄂托克旗| 林周县| 宁安市| 惠来县| 平凉市| 富锦市| 周口市| 射洪县| 吴川市| 吴堡县| 两当县| 金塔县| 江口县|