{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/32493742","id":32493742,"diff_hunk":"@@ -0,0 +1,63 @@\n+class PcapDnsproxy < Formula\n+  desc \"A powerful DNS proxy designed to anti DNS spoofing\"\n+  homepage \"https://github.com/chengr28/Pcap_DNSProxy\"\n+  url \"https://github.com/chengr28/Pcap_DNSProxy/archive/v0.4.2.tar.gz\"\n+  sha256 \"0737b16283e84bc94f63066f448ba84416141b8d5a86b5e01f1f97164d9d44f2\"\n+  head \"https://github.com/chengr28/Pcap_DNSProxy.git\"\n+\n+  depends_on :xcode => :build\n+  depends_on \"libsodium\" => :build\n+\n+  def install\n+    rm Dir[buildpath/\"Source/LibSodium/*\"]\n+    ln_s \"#{Formula[\"libsodium\"].opt_lib}/libsodium.a\", \"#{buildpath}/Source/LibSodium/LibSodium_Mac.a\"\n+    ln_s Dir[Formula[\"libsodium\"].opt_include/\"*\"], \"#{buildpath}/Source/LibSodium/\"\n+    xcodebuild \"-project\", \"./Source/KeyPairGenerator.xcodeproj\", \"-target\", \"KeyPairGenerator\", \"-configuration\", \"Release\", \"SYMROOT=build\"\n+    xcodebuild \"-project\", \"./Source/Pcap_DNSProxy.xcodeproj\", \"-target\", \"Pcap_DNSProxy\", \"-configuration\", \"Release\", \"SYMROOT=build\"\n+\n+    bin.install \"Source/build/Release/KeyPairGenerator\"\n+    bin.install \"Source/build/Release/Pcap_DNSProxy\"\n+    (etc/\"pcap_DNSproxy\").install Dir[\"Source/ExampleConfig/*.{ini,txt}\"]\n+  end\n+\n+  test do\n+    mkdir testpath/\"pcap_dnsproxy\"\n+    cp Dir[etc/\"pcap_dnsproxy/*\"], testpath/\"pcap_dnsproxy/\"\n+    inreplace testpath/\"pcap_dnsproxy/Config.ini\" do |s|\n+      s.gsub! /Hosts Only.*/, \"Hosts Only = 1\"\n+      s.gsub! /Listen Port.*/, \"Listen Port = 9999\"\n+    end\n+    pid = fork do\n+        exec bin/\"Pcap_DNSProxy\", \"-c\", testpath/\"pcap_dnsproxy/\", [:out, :err]=>\"/dev/null\"\n+    end\n+    system \"dig\", \"google.com\", \"@127.0.0.1\", \"-p\", \"9999\", \"+short\"\n+    Process.kill \"TERM\", pid","path":"Library/Formula/pcap_dnsproxy.rb","position":34,"original_position":34,"commit_id":"f38b11bcf90c5c2c5c3ee1add719a4f51404dfb2","original_commit_id":"f38b11bcf90c5c2c5c3ee1add719a4f51404dfb2","user":{"login":"xu-cheng","id":3105373,"avatar_url":"https://avatars.githubusercontent.com/u/3105373?v=3","gravatar_id":"","url":"https://api.github.com/users/xu-cheng","html_url":"https://github.com/xu-cheng","followers_url":"https://api.github.com/users/xu-cheng/followers","following_url":"https://api.github.com/users/xu-cheng/following{/other_user}","gists_url":"https://api.github.com/users/xu-cheng/gists{/gist_id}","starred_url":"https://api.github.com/users/xu-cheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xu-cheng/subscriptions","organizations_url":"https://api.github.com/users/xu-cheng/orgs","repos_url":"https://api.github.com/users/xu-cheng/repos","events_url":"https://api.github.com/users/xu-cheng/events{/privacy}","received_events_url":"https://api.github.com/users/xu-cheng/received_events","type":"User","site_admin":false},"body":"Let's do this:\r\n```ruby\r\npid = fork { system bin/\"Pcap_DNSProxy\", \"-c\", testpath/\"pcap_dnsproxy/\" }\r\nbegin\r\n  system \"dig\", \"google.com\", \"@127.0.0.1\", \"-p\", \"9999\", \"+short\"\r\nensure\r\n  Process.kill 9, pid\r\n  Process.wait pid\r\nend\r\n```","created_at":"2015-06-16T06:19:39Z","updated_at":"2015-06-16T06:19:39Z","html_url":"https://github.com/Homebrew/homebrew/pull/40381#discussion_r32493742","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/32493742"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/40381#discussion_r32493742"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381","id":36941632,"html_url":"https://github.com/Homebrew/homebrew/pull/40381","diff_url":"https://github.com/Homebrew/homebrew/pull/40381.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/40381.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/40381","number":40381,"state":"open","locked":false,"title":"Pcap_DNSProxy v0.4.2 (new formula)","user":{"login":"blackgear","id":4780199,"avatar_url":"https://avatars.githubusercontent.com/u/4780199?v=3","gravatar_id":"","url":"https://api.github.com/users/blackgear","html_url":"https://github.com/blackgear","followers_url":"https://api.github.com/users/blackgear/followers","following_url":"https://api.github.com/users/blackgear/following{/other_user}","gists_url":"https://api.github.com/users/blackgear/gists{/gist_id}","starred_url":"https://api.github.com/users/blackgear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackgear/subscriptions","organizations_url":"https://api.github.com/users/blackgear/orgs","repos_url":"https://api.github.com/users/blackgear/repos","events_url":"https://api.github.com/users/blackgear/events{/privacy}","received_events_url":"https://api.github.com/users/blackgear/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-04T14:47:59Z","updated_at":"2015-06-16T06:19:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18dfd67c7cbc2c29feedb37a2913d51fdafb9899","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/40381/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/f38b11bcf90c5c2c5c3ee1add719a4f51404dfb2","head":{"label":"blackgear:pcap_dnsproxy","ref":"pcap_dnsproxy","sha":"f38b11bcf90c5c2c5c3ee1add719a4f51404dfb2","user":{"login":"blackgear","id":4780199,"avatar_url":"https://avatars.githubusercontent.com/u/4780199?v=3","gravatar_id":"","url":"https://api.github.com/users/blackgear","html_url":"https://github.com/blackgear","followers_url":"https://api.github.com/users/blackgear/followers","following_url":"https://api.github.com/users/blackgear/following{/other_user}","gists_url":"https://api.github.com/users/blackgear/gists{/gist_id}","starred_url":"https://api.github.com/users/blackgear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackgear/subscriptions","organizations_url":"https://api.github.com/users/blackgear/orgs","repos_url":"https://api.github.com/users/blackgear/repos","events_url":"https://api.github.com/users/blackgear/events{/privacy}","received_events_url":"https://api.github.com/users/blackgear/received_events","type":"User","site_admin":false},"repo":{"id":30348189,"name":"homebrew","full_name":"blackgear/homebrew","owner":{"login":"blackgear","id":4780199,"avatar_url":"https://avatars.githubusercontent.com/u/4780199?v=3","gravatar_id":"","url":"https://api.github.com/users/blackgear","html_url":"https://github.com/blackgear","followers_url":"https://api.github.com/users/blackgear/followers","following_url":"https://api.github.com/users/blackgear/following{/other_user}","gists_url":"https://api.github.com/users/blackgear/gists{/gist_id}","starred_url":"https://api.github.com/users/blackgear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackgear/subscriptions","organizations_url":"https://api.github.com/users/blackgear/orgs","repos_url":"https://api.github.com/users/blackgear/repos","events_url":"https://api.github.com/users/blackgear/events{/privacy}","received_events_url":"https://api.github.com/users/blackgear/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blackgear/homebrew","description":"The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/blackgear/homebrew","forks_url":"https://api.github.com/repos/blackgear/homebrew/forks","keys_url":"https://api.github.com/repos/blackgear/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blackgear/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blackgear/homebrew/teams","hooks_url":"https://api.github.com/repos/blackgear/homebrew/hooks","issue_events_url":"https://api.github.com/repos/blackgear/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/blackgear/homebrew/events","assignees_url":"https://api.github.com/repos/blackgear/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/blackgear/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/blackgear/homebrew/tags","blobs_url":"https://api.github.com/repos/blackgear/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blackgear/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blackgear/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/blackgear/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blackgear/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/blackgear/homebrew/languages","stargazers_url":"https://api.github.com/repos/blackgear/homebrew/stargazers","contributors_url":"https://api.github.com/repos/blackgear/homebrew/contributors","subscribers_url":"https://api.github.com/repos/blackgear/homebrew/subscribers","subscription_url":"https://api.github.com/repos/blackgear/homebrew/subscription","commits_url":"https://api.github.com/repos/blackgear/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/blackgear/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/blackgear/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/blackgear/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/blackgear/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/blackgear/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blackgear/homebrew/merges","archive_url":"https://api.github.com/repos/blackgear/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blackgear/homebrew/downloads","issues_url":"https://api.github.com/repos/blackgear/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/blackgear/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/blackgear/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/blackgear/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blackgear/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/blackgear/homebrew/releases{/id}","created_at":"2015-02-05T09:44:57Z","updated_at":"2015-02-05T09:45:12Z","pushed_at":"2015-06-15T19:04:59Z","git_url":"git://github.com/blackgear/homebrew.git","ssh_url":"git@github.com:blackgear/homebrew.git","clone_url":"https://github.com/blackgear/homebrew.git","svn_url":"https://github.com/blackgear/homebrew","homepage":"http://brew.sh","size":46698,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"b3c83a6a7aedf11abc5780a0895a4da92a9f0ecd","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-06-16T06:15:38Z","pushed_at":"2015-06-16T06:13:23Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1546603,"stargazers_count":23637,"watchers_count":23637,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":11839,"mirror_url":null,"open_issues_count":337,"forks":11839,"open_issues":337,"watchers":23637,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/40381"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/40381"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/40381/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/40381/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/f38b11bcf90c5c2c5c3ee1add719a4f51404dfb2"}}}}