{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tcurl/pulls/comments/40836420","id":40836420,"diff_hunk":"@@ -118,17 +118,25 @@ function parseArgs(argv) {\n     var endpoint = argv._[1];\n     var health = argv.health;\n \n-    var uri = argv.hostlist ?\n-        JSON.parse(fs.readFileSync(argv.hostlist))[0] : argv.peer;\n+    var peers = argv.hostlist ?\n+        JSON.parse(fs.readFileSync(argv.hostlist)) : [argv.peer];\n \n-    var parsedUri = url.parse('tchannel://' + uri);\n-\n-    if (parsedUri.hostname === 'localhost') {\n-        parsedUri.hostname = myLocalIp();\n+    var ip;\n+    function normalizePeer(address) {\n+        if (!ip) {\n+            ip = myLocalIp();\n+        }\n+        var parsedUri = url.parse('tchannel://' + address);\n+        if (parsedUri.hostname === 'localhost') {","path":"index.js","position":19,"original_position":19,"commit_id":"74cfc08f4b0d9566a5e363b4a86f2f3fc039da43","original_commit_id":"74cfc08f4b0d9566a5e363b4a86f2f3fc039da43","user":{"login":"jcorbin","id":49715,"avatar_url":"https://avatars.githubusercontent.com/u/49715?v=3","gravatar_id":"","url":"https://api.github.com/users/jcorbin","html_url":"https://github.com/jcorbin","followers_url":"https://api.github.com/users/jcorbin/followers","following_url":"https://api.github.com/users/jcorbin/following{/other_user}","gists_url":"https://api.github.com/users/jcorbin/gists{/gist_id}","starred_url":"https://api.github.com/users/jcorbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcorbin/subscriptions","organizations_url":"https://api.github.com/users/jcorbin/orgs","repos_url":"https://api.github.com/users/jcorbin/repos","events_url":"https://api.github.com/users/jcorbin/events{/privacy}","received_events_url":"https://api.github.com/users/jcorbin/received_events","type":"User","site_admin":false},"body":"similar nonsense still persisting... why?","created_at":"2015-09-30T19:01:26Z","updated_at":"2015-09-30T19:01:26Z","html_url":"https://github.com/uber/tcurl/pull/58#discussion_r40836420","pull_request_url":"https://api.github.com/repos/uber/tcurl/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/uber/tcurl/pulls/comments/40836420"},"html":{"href":"https://github.com/uber/tcurl/pull/58#discussion_r40836420"},"pull_request":{"href":"https://api.github.com/repos/uber/tcurl/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tcurl/pulls/58","id":46322852,"html_url":"https://github.com/uber/tcurl/pull/58","diff_url":"https://github.com/uber/tcurl/pull/58.diff","patch_url":"https://github.com/uber/tcurl/pull/58.patch","issue_url":"https://api.github.com/repos/uber/tcurl/issues/58","number":58,"state":"open","locked":false,"title":"Choose a random peer from host list","user":{"login":"kriskowal","id":60294,"avatar_url":"https://avatars.githubusercontent.com/u/60294?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskowal","html_url":"https://github.com/kriskowal","followers_url":"https://api.github.com/users/kriskowal/followers","following_url":"https://api.github.com/users/kriskowal/following{/other_user}","gists_url":"https://api.github.com/users/kriskowal/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskowal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskowal/subscriptions","organizations_url":"https://api.github.com/users/kriskowal/orgs","repos_url":"https://api.github.com/users/kriskowal/repos","events_url":"https://api.github.com/users/kriskowal/events{/privacy}","received_events_url":"https://api.github.com/users/kriskowal/received_events","type":"User","site_admin":false},"body":"r @shannili @jcorbin @raynos","created_at":"2015-09-29T19:46:47Z","updated_at":"2015-09-30T19:01:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e00b4245aa7ded7f0e7f886d096ac4e600588c0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tcurl/pulls/58/commits","review_comments_url":"https://api.github.com/repos/uber/tcurl/pulls/58/comments","review_comment_url":"https://api.github.com/repos/uber/tcurl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tcurl/issues/58/comments","statuses_url":"https://api.github.com/repos/uber/tcurl/statuses/74cfc08f4b0d9566a5e363b4a86f2f3fc039da43","head":{"label":"uber:peers","ref":"peers","sha":"74cfc08f4b0d9566a5e363b4a86f2f3fc039da43","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":31385838,"name":"tcurl","full_name":"uber/tcurl","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tcurl","description":"A command line utility to talk to tchannel servers","fork":false,"url":"https://api.github.com/repos/uber/tcurl","forks_url":"https://api.github.com/repos/uber/tcurl/forks","keys_url":"https://api.github.com/repos/uber/tcurl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tcurl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tcurl/teams","hooks_url":"https://api.github.com/repos/uber/tcurl/hooks","issue_events_url":"https://api.github.com/repos/uber/tcurl/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tcurl/events","assignees_url":"https://api.github.com/repos/uber/tcurl/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tcurl/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tcurl/tags","blobs_url":"https://api.github.com/repos/uber/tcurl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tcurl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tcurl/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tcurl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tcurl/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tcurl/languages","stargazers_url":"https://api.github.com/repos/uber/tcurl/stargazers","contributors_url":"https://api.github.com/repos/uber/tcurl/contributors","subscribers_url":"https://api.github.com/repos/uber/tcurl/subscribers","subscription_url":"https://api.github.com/repos/uber/tcurl/subscription","commits_url":"https://api.github.com/repos/uber/tcurl/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tcurl/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tcurl/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tcurl/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tcurl/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tcurl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tcurl/merges","archive_url":"https://api.github.com/repos/uber/tcurl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tcurl/downloads","issues_url":"https://api.github.com/repos/uber/tcurl/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tcurl/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tcurl/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tcurl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tcurl/labels{/name}","releases_url":"https://api.github.com/repos/uber/tcurl/releases{/id}","created_at":"2015-02-26T19:55:20Z","updated_at":"2015-09-26T15:35:05Z","pushed_at":"2015-09-29T23:18:22Z","git_url":"git://github.com/uber/tcurl.git","ssh_url":"git@github.com:uber/tcurl.git","clone_url":"https://github.com/uber/tcurl.git","svn_url":"https://github.com/uber/tcurl","homepage":null,"size":766,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":5,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"64339f7f8bab532525494e4726b69ab7e393e8d9","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":31385838,"name":"tcurl","full_name":"uber/tcurl","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tcurl","description":"A command line utility to talk to tchannel servers","fork":false,"url":"https://api.github.com/repos/uber/tcurl","forks_url":"https://api.github.com/repos/uber/tcurl/forks","keys_url":"https://api.github.com/repos/uber/tcurl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tcurl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tcurl/teams","hooks_url":"https://api.github.com/repos/uber/tcurl/hooks","issue_events_url":"https://api.github.com/repos/uber/tcurl/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tcurl/events","assignees_url":"https://api.github.com/repos/uber/tcurl/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tcurl/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tcurl/tags","blobs_url":"https://api.github.com/repos/uber/tcurl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tcurl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tcurl/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tcurl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tcurl/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tcurl/languages","stargazers_url":"https://api.github.com/repos/uber/tcurl/stargazers","contributors_url":"https://api.github.com/repos/uber/tcurl/contributors","subscribers_url":"https://api.github.com/repos/uber/tcurl/subscribers","subscription_url":"https://api.github.com/repos/uber/tcurl/subscription","commits_url":"https://api.github.com/repos/uber/tcurl/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tcurl/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tcurl/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tcurl/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tcurl/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tcurl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tcurl/merges","archive_url":"https://api.github.com/repos/uber/tcurl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tcurl/downloads","issues_url":"https://api.github.com/repos/uber/tcurl/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tcurl/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tcurl/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tcurl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tcurl/labels{/name}","releases_url":"https://api.github.com/repos/uber/tcurl/releases{/id}","created_at":"2015-02-26T19:55:20Z","updated_at":"2015-09-26T15:35:05Z","pushed_at":"2015-09-29T23:18:22Z","git_url":"git://github.com/uber/tcurl.git","ssh_url":"git@github.com:uber/tcurl.git","clone_url":"https://github.com/uber/tcurl.git","svn_url":"https://github.com/uber/tcurl","homepage":null,"size":766,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tcurl/pulls/58"},"html":{"href":"https://github.com/uber/tcurl/pull/58"},"issue":{"href":"https://api.github.com/repos/uber/tcurl/issues/58"},"comments":{"href":"https://api.github.com/repos/uber/tcurl/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tcurl/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tcurl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tcurl/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tcurl/statuses/74cfc08f4b0d9566a5e363b4a86f2f3fc039da43"}}}}