{"action":"created","comment":{"url":"https://api.github.com/repos/google/tcpproxy/pulls/comments/126022939","pull_request_review_id":48469998,"id":126022939,"diff_hunk":"@@ -44,6 +63,74 @@ func (m sniMatch) match(br *bufio.Reader) Target {\n \treturn nil\n }\n \n+type acmeMatch []Target\n+\n+func (m *acmeMatch) match(br *bufio.Reader) Target {\n+\tsni := clientHelloServerName(br)\n+\tif !strings.HasSuffix(sni, \".acme.invalid\") {\n+\t\treturn nil\n+\t}\n+\n+\t// TODO: cache. Acme issuers will hit multiple times in a short\n+\t// burst for each issuance event. A short TTL cache + singleflight\n+\t// should have an excellent hit rate.\n+\t// TODO: maybe an acme-specific timeout as well?\n+\t// TODO: plumb context upwards?\n+\tctx, cancel := context.WithCancel(context.Background())\n+\tdefer cancel()\n+\n+\tch := make(chan Target, len(*m))\n+\tfor _, target := range *m {\n+\t\tgo tryAcme(ctx, ch, target, sni)","path":"sni.go","position":69,"original_position":63,"commit_id":"5ce777a57c4f862acf8d9bf6a70ac4bb44ffa4f2","original_commit_id":"5ce777a57c4f862acf8d9bf6a70ac4bb44ffa4f2","user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars2.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"body":"tryACME, etc","created_at":"2017-07-06T21:38:41Z","updated_at":"2017-07-06T21:40:22Z","html_url":"https://github.com/google/tcpproxy/pull/7#discussion_r126022939","pull_request_url":"https://api.github.com/repos/google/tcpproxy/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/comments/126022939"},"html":{"href":"https://github.com/google/tcpproxy/pull/7#discussion_r126022939"},"pull_request":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/google/tcpproxy/pulls/7","id":129284820,"html_url":"https://github.com/google/tcpproxy/pull/7","diff_url":"https://github.com/google/tcpproxy/pull/7.diff","patch_url":"https://github.com/google/tcpproxy/pull/7.patch","issue_url":"https://api.github.com/repos/google/tcpproxy/issues/7","number":7,"state":"open","locked":false,"title":"Add support for routing ACME tls-sni-01 challenges.","user":{"login":"danderson","id":1918,"avatar_url":"https://avatars3.githubusercontent.com/u/1918?v=3","gravatar_id":"","url":"https://api.github.com/users/danderson","html_url":"https://github.com/danderson","followers_url":"https://api.github.com/users/danderson/followers","following_url":"https://api.github.com/users/danderson/following{/other_user}","gists_url":"https://api.github.com/users/danderson/gists{/gist_id}","starred_url":"https://api.github.com/users/danderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danderson/subscriptions","organizations_url":"https://api.github.com/users/danderson/orgs","repos_url":"https://api.github.com/users/danderson/repos","events_url":"https://api.github.com/users/danderson/events{/privacy}","received_events_url":"https://api.github.com/users/danderson/received_events","type":"User","site_admin":false},"body":"CL is in two parts: a refactoring of routes and matchers to allow for matchers that pick a target at runtime, and then the ACME support itself.\r\n\r\nIn addition to usual code review stuff, bikeshedding on function names, docstrings, and the usefulness of TODOs is welcome.","created_at":"2017-07-06T21:25:50Z","updated_at":"2017-07-06T21:40:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30a229ef9ba3def7bbdfe8f0db99875ae5443206","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/tcpproxy/pulls/7/commits","review_comments_url":"https://api.github.com/repos/google/tcpproxy/pulls/7/comments","review_comment_url":"https://api.github.com/repos/google/tcpproxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/tcpproxy/issues/7/comments","statuses_url":"https://api.github.com/repos/google/tcpproxy/statuses/5ce777a57c4f862acf8d9bf6a70ac4bb44ffa4f2","head":{"label":"danderson:acme-spam","ref":"acme-spam","sha":"5ce777a57c4f862acf8d9bf6a70ac4bb44ffa4f2","user":{"login":"danderson","id":1918,"avatar_url":"https://avatars3.githubusercontent.com/u/1918?v=3","gravatar_id":"","url":"https://api.github.com/users/danderson","html_url":"https://github.com/danderson","followers_url":"https://api.github.com/users/danderson/followers","following_url":"https://api.github.com/users/danderson/following{/other_user}","gists_url":"https://api.github.com/users/danderson/gists{/gist_id}","starred_url":"https://api.github.com/users/danderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danderson/subscriptions","organizations_url":"https://api.github.com/users/danderson/orgs","repos_url":"https://api.github.com/users/danderson/repos","events_url":"https://api.github.com/users/danderson/events{/privacy}","received_events_url":"https://api.github.com/users/danderson/received_events","type":"User","site_admin":false},"repo":{"id":96401741,"name":"tcpproxy","full_name":"danderson/tcpproxy","owner":{"login":"danderson","id":1918,"avatar_url":"https://avatars3.githubusercontent.com/u/1918?v=3","gravatar_id":"","url":"https://api.github.com/users/danderson","html_url":"https://github.com/danderson","followers_url":"https://api.github.com/users/danderson/followers","following_url":"https://api.github.com/users/danderson/following{/other_user}","gists_url":"https://api.github.com/users/danderson/gists{/gist_id}","starred_url":"https://api.github.com/users/danderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danderson/subscriptions","organizations_url":"https://api.github.com/users/danderson/orgs","repos_url":"https://api.github.com/users/danderson/repos","events_url":"https://api.github.com/users/danderson/events{/privacy}","received_events_url":"https://api.github.com/users/danderson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danderson/tcpproxy","description":null,"fork":true,"url":"https://api.github.com/repos/danderson/tcpproxy","forks_url":"https://api.github.com/repos/danderson/tcpproxy/forks","keys_url":"https://api.github.com/repos/danderson/tcpproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danderson/tcpproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danderson/tcpproxy/teams","hooks_url":"https://api.github.com/repos/danderson/tcpproxy/hooks","issue_events_url":"https://api.github.com/repos/danderson/tcpproxy/issues/events{/number}","events_url":"https://api.github.com/repos/danderson/tcpproxy/events","assignees_url":"https://api.github.com/repos/danderson/tcpproxy/assignees{/user}","branches_url":"https://api.github.com/repos/danderson/tcpproxy/branches{/branch}","tags_url":"https://api.github.com/repos/danderson/tcpproxy/tags","blobs_url":"https://api.github.com/repos/danderson/tcpproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danderson/tcpproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danderson/tcpproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/danderson/tcpproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danderson/tcpproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/danderson/tcpproxy/languages","stargazers_url":"https://api.github.com/repos/danderson/tcpproxy/stargazers","contributors_url":"https://api.github.com/repos/danderson/tcpproxy/contributors","subscribers_url":"https://api.github.com/repos/danderson/tcpproxy/subscribers","subscription_url":"https://api.github.com/repos/danderson/tcpproxy/subscription","commits_url":"https://api.github.com/repos/danderson/tcpproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/danderson/tcpproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/danderson/tcpproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/danderson/tcpproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/danderson/tcpproxy/contents/{+path}","compare_url":"https://api.github.com/repos/danderson/tcpproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danderson/tcpproxy/merges","archive_url":"https://api.github.com/repos/danderson/tcpproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danderson/tcpproxy/downloads","issues_url":"https://api.github.com/repos/danderson/tcpproxy/issues{/number}","pulls_url":"https://api.github.com/repos/danderson/tcpproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/danderson/tcpproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/danderson/tcpproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danderson/tcpproxy/labels{/name}","releases_url":"https://api.github.com/repos/danderson/tcpproxy/releases{/id}","deployments_url":"https://api.github.com/repos/danderson/tcpproxy/deployments","created_at":"2017-07-06T07:31:10Z","updated_at":"2017-07-06T07:31:11Z","pushed_at":"2017-07-06T21:14:28Z","git_url":"git://github.com/danderson/tcpproxy.git","ssh_url":"git@github.com:danderson/tcpproxy.git","clone_url":"https://github.com/danderson/tcpproxy.git","svn_url":"https://github.com/danderson/tcpproxy","homepage":null,"size":66,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"e03035937341374a9be6eb8459ffe4f23bacd185","user":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":76297804,"name":"tcpproxy","full_name":"google/tcpproxy","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/tcpproxy","description":null,"fork":false,"url":"https://api.github.com/repos/google/tcpproxy","forks_url":"https://api.github.com/repos/google/tcpproxy/forks","keys_url":"https://api.github.com/repos/google/tcpproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/tcpproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/tcpproxy/teams","hooks_url":"https://api.github.com/repos/google/tcpproxy/hooks","issue_events_url":"https://api.github.com/repos/google/tcpproxy/issues/events{/number}","events_url":"https://api.github.com/repos/google/tcpproxy/events","assignees_url":"https://api.github.com/repos/google/tcpproxy/assignees{/user}","branches_url":"https://api.github.com/repos/google/tcpproxy/branches{/branch}","tags_url":"https://api.github.com/repos/google/tcpproxy/tags","blobs_url":"https://api.github.com/repos/google/tcpproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/tcpproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/tcpproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/tcpproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/tcpproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/google/tcpproxy/languages","stargazers_url":"https://api.github.com/repos/google/tcpproxy/stargazers","contributors_url":"https://api.github.com/repos/google/tcpproxy/contributors","subscribers_url":"https://api.github.com/repos/google/tcpproxy/subscribers","subscription_url":"https://api.github.com/repos/google/tcpproxy/subscription","commits_url":"https://api.github.com/repos/google/tcpproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/tcpproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/tcpproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/tcpproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/tcpproxy/contents/{+path}","compare_url":"https://api.github.com/repos/google/tcpproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/tcpproxy/merges","archive_url":"https://api.github.com/repos/google/tcpproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/tcpproxy/downloads","issues_url":"https://api.github.com/repos/google/tcpproxy/issues{/number}","pulls_url":"https://api.github.com/repos/google/tcpproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/google/tcpproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/google/tcpproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/tcpproxy/labels{/name}","releases_url":"https://api.github.com/repos/google/tcpproxy/releases{/id}","deployments_url":"https://api.github.com/repos/google/tcpproxy/deployments","created_at":"2016-12-12T21:38:45Z","updated_at":"2017-07-06T19:58:35Z","pushed_at":"2017-07-06T21:25:51Z","git_url":"git://github.com/google/tcpproxy.git","ssh_url":"git@github.com:google/tcpproxy.git","clone_url":"https://github.com/google/tcpproxy.git","svn_url":"https://github.com/google/tcpproxy","homepage":null,"size":62,"stargazers_count":106,"watchers_count":106,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/7"},"html":{"href":"https://github.com/google/tcpproxy/pull/7"},"issue":{"href":"https://api.github.com/repos/google/tcpproxy/issues/7"},"comments":{"href":"https://api.github.com/repos/google/tcpproxy/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/tcpproxy/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/google/tcpproxy/statuses/5ce777a57c4f862acf8d9bf6a70ac4bb44ffa4f2"}}}}
{"actor":{"display_login":"bradfitz"}}