{"action":"created","comment":{"url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/comments/24875188","id":24875188,"diff_hunk":"@@ -0,0 +1,128 @@\n+#include <stdlib.h>\n+#include <windows.h>\n+#include <Wininet.h>\n+#include <ras.h>\n+#include <tchar.h>\n+#include <stdio.h>\n+#include \"common.h\"\n+\n+void reportWindowsError(const char* action) {\n+  LPTSTR pErrMsg = NULL;\n+  DWORD errCode = GetLastError();\n+  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|\n+      FORMAT_MESSAGE_FROM_SYSTEM|\n+      FORMAT_MESSAGE_ARGUMENT_ARRAY,\n+      NULL,\n+      errCode,\n+      LANG_NEUTRAL,\n+      pErrMsg,\n+      0,\n+      NULL);\n+  printf(\"Error %s: %lu %s\\n\", action, errCode, pErrMsg);\n+}\n+\n+// Figure out which Dial-Up or VPN connection is active; in a normal LAN connection, this should\n+// return NULL. NOTE: For some reason this method fails when compiled in Debug mode but works\n+// every time in Release mode.\n+LPTSTR FindActiveConnection() {","path":"windows.c","position":27,"original_position":27,"commit_id":"8f04811e9970078d287741b98a140b4f6996fc72","original_commit_id":"8f04811e9970078d287741b98a140b4f6996fc72","user":{"login":"fffw","id":10410437,"avatar_url":"https://avatars.githubusercontent.com/u/10410437?v=3","gravatar_id":"","url":"https://api.github.com/users/fffw","html_url":"https://github.com/fffw","followers_url":"https://api.github.com/users/fffw/followers","following_url":"https://api.github.com/users/fffw/following{/other_user}","gists_url":"https://api.github.com/users/fffw/gists{/gist_id}","starred_url":"https://api.github.com/users/fffw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fffw/subscriptions","organizations_url":"https://api.github.com/users/fffw/orgs","repos_url":"https://api.github.com/users/fffw/repos","events_url":"https://api.github.com/users/fffw/events{/privacy}","received_events_url":"https://api.github.com/users/fffw/received_events","type":"User","site_admin":false},"body":"winproxy has another feature of change proxy directly, rather than pac. Not sure if it is in use. @myleshorton ","created_at":"2015-02-18T02:28:37Z","updated_at":"2015-02-18T02:28:37Z","html_url":"https://github.com/getlantern/pac-cmd/pull/1#discussion_r24875188","pull_request_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/comments/24875188"},"html":{"href":"https://github.com/getlantern/pac-cmd/pull/1#discussion_r24875188"},"pull_request":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1","id":29317406,"html_url":"https://github.com/getlantern/pac-cmd/pull/1","diff_url":"https://github.com/getlantern/pac-cmd/pull/1.diff","patch_url":"https://github.com/getlantern/pac-cmd/pull/1.patch","issue_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/1","number":1,"state":"open","locked":false,"title":"Compose pac tool","user":{"login":"fffw","id":10410437,"avatar_url":"https://avatars.githubusercontent.com/u/10410437?v=3","gravatar_id":"","url":"https://api.github.com/users/fffw","html_url":"https://github.com/fffw","followers_url":"https://api.github.com/users/fffw/followers","following_url":"https://api.github.com/users/fffw/following{/other_user}","gists_url":"https://api.github.com/users/fffw/gists{/gist_id}","starred_url":"https://api.github.com/users/fffw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fffw/subscriptions","organizations_url":"https://api.github.com/users/fffw/orgs","repos_url":"https://api.github.com/users/fffw/repos","events_url":"https://api.github.com/users/fffw/events{/privacy}","received_events_url":"https://api.github.com/users/fffw/received_events","type":"User","site_admin":false},"body":"Now it works as a command line tool with only `on` and `off` switch, along with a hidden switch `setuid` under Mac to setuid on itself and chmod to root:wheel, which must be invoked through `AuthorizationExecuteWithPrivileges`.","created_at":"2015-02-14T07:51:14Z","updated_at":"2015-02-18T02:28:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e5c0c952787bd52f023220ec3e110275fae11c1","assignee":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1/commits","review_comments_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1/comments","review_comment_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls/comments/{number}","comments_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/1/comments","statuses_url":"https://api.github.com/repos/getlantern/pac-cmd/statuses/8f04811e9970078d287741b98a140b4f6996fc72","head":{"label":"getlantern:init","ref":"init","sha":"8f04811e9970078d287741b98a140b4f6996fc72","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":30786111,"name":"pac-cmd","full_name":"getlantern/pac-cmd","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/pac-cmd","description":"command line tool to change proxy auto-config settings of operation system","fork":false,"url":"https://api.github.com/repos/getlantern/pac-cmd","forks_url":"https://api.github.com/repos/getlantern/pac-cmd/forks","keys_url":"https://api.github.com/repos/getlantern/pac-cmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/pac-cmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/pac-cmd/teams","hooks_url":"https://api.github.com/repos/getlantern/pac-cmd/hooks","issue_events_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/pac-cmd/events","assignees_url":"https://api.github.com/repos/getlantern/pac-cmd/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/pac-cmd/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/pac-cmd/tags","blobs_url":"https://api.github.com/repos/getlantern/pac-cmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/pac-cmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/pac-cmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/pac-cmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/pac-cmd/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/pac-cmd/languages","stargazers_url":"https://api.github.com/repos/getlantern/pac-cmd/stargazers","contributors_url":"https://api.github.com/repos/getlantern/pac-cmd/contributors","subscribers_url":"https://api.github.com/repos/getlantern/pac-cmd/subscribers","subscription_url":"https://api.github.com/repos/getlantern/pac-cmd/subscription","commits_url":"https://api.github.com/repos/getlantern/pac-cmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/pac-cmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/pac-cmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/getlantern/pac-cmd/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/pac-cmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/pac-cmd/merges","archive_url":"https://api.github.com/repos/getlantern/pac-cmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/pac-cmd/downloads","issues_url":"https://api.github.com/repos/getlantern/pac-cmd/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/pac-cmd/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/pac-cmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/pac-cmd/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/pac-cmd/releases{/id}","created_at":"2015-02-14T03:37:36Z","updated_at":"2015-02-14T03:37:36Z","pushed_at":"2015-02-14T07:41:57Z","git_url":"git://github.com/getlantern/pac-cmd.git","ssh_url":"git@github.com:getlantern/pac-cmd.git","clone_url":"https://github.com/getlantern/pac-cmd.git","svn_url":"https://github.com/getlantern/pac-cmd","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"getlantern:master","ref":"master","sha":"c1355eae6fa84d718ed814214ac4e21a7b7eddba","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":30786111,"name":"pac-cmd","full_name":"getlantern/pac-cmd","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/pac-cmd","description":"command line tool to change proxy auto-config settings of operation system","fork":false,"url":"https://api.github.com/repos/getlantern/pac-cmd","forks_url":"https://api.github.com/repos/getlantern/pac-cmd/forks","keys_url":"https://api.github.com/repos/getlantern/pac-cmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/pac-cmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/pac-cmd/teams","hooks_url":"https://api.github.com/repos/getlantern/pac-cmd/hooks","issue_events_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/pac-cmd/events","assignees_url":"https://api.github.com/repos/getlantern/pac-cmd/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/pac-cmd/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/pac-cmd/tags","blobs_url":"https://api.github.com/repos/getlantern/pac-cmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/pac-cmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/pac-cmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/pac-cmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/pac-cmd/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/pac-cmd/languages","stargazers_url":"https://api.github.com/repos/getlantern/pac-cmd/stargazers","contributors_url":"https://api.github.com/repos/getlantern/pac-cmd/contributors","subscribers_url":"https://api.github.com/repos/getlantern/pac-cmd/subscribers","subscription_url":"https://api.github.com/repos/getlantern/pac-cmd/subscription","commits_url":"https://api.github.com/repos/getlantern/pac-cmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/pac-cmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/pac-cmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/pac-cmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/getlantern/pac-cmd/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/pac-cmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/pac-cmd/merges","archive_url":"https://api.github.com/repos/getlantern/pac-cmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/pac-cmd/downloads","issues_url":"https://api.github.com/repos/getlantern/pac-cmd/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/pac-cmd/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/pac-cmd/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/pac-cmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/pac-cmd/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/pac-cmd/releases{/id}","created_at":"2015-02-14T03:37:36Z","updated_at":"2015-02-14T03:37:36Z","pushed_at":"2015-02-14T07:41:57Z","git_url":"git://github.com/getlantern/pac-cmd.git","ssh_url":"git@github.com:getlantern/pac-cmd.git","clone_url":"https://github.com/getlantern/pac-cmd.git","svn_url":"https://github.com/getlantern/pac-cmd","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1"},"html":{"href":"https://github.com/getlantern/pac-cmd/pull/1"},"issue":{"href":"https://api.github.com/repos/getlantern/pac-cmd/issues/1"},"comments":{"href":"https://api.github.com/repos/getlantern/pac-cmd/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/getlantern/pac-cmd/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/getlantern/pac-cmd/statuses/8f04811e9970078d287741b98a140b4f6996fc72"}}}}