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 閱讀(4088) | 評論 (2)編輯 收藏

          主站蜘蛛池模板: 沁源县| 平江县| 沛县| 平昌县| 丰都县| 郎溪县| 东宁县| 都安| 正阳县| 威信县| 静海县| 繁峙县| 永春县| 班戈县| 广南县| 延川县| 吉隆县| 垫江县| 滨州市| 缙云县| 福安市| 茶陵县| 连州市| 井冈山市| 浮梁县| 偏关县| 腾冲县| 姜堰市| 天台县| 开鲁县| 徐水县| 增城市| 东丽区| 崇明县| 唐海县| 平遥县| 苏州市| 永城市| 木里| 岗巴县| 札达县|