{"action":"created","comment":{"url":"https://api.github.com/repos/xjdr/xio/pulls/comments/175237786","pull_request_review_id":104745259,"id":175237786,"diff_hunk":"@@ -0,0 +1,34 @@\n+package com.xjeffrose.xio.core;\n+\n+import io.netty.channel.Channel;\n+import io.netty.channel.socket.ServerSocketChannel;\n+import io.netty.channel.socket.SocketChannel;\n+import java.net.InetSocketAddress;\n+import javax.annotation.Nullable;\n+import lombok.val;\n+\n+public class SocketAddressHelper {\n+\n+  @Nullable\n+  public static String extractRemoteAddress(Channel channel) {\n+    if (channel instanceof ServerSocketChannel) {\n+      val inetSocketAddress = ((ServerSocketChannel) channel).remoteAddress();\n+      return computeAddress(inetSocketAddress);\n+    } else if (channel instanceof SocketChannel) {\n+      val inetSocketAddress = ((SocketChannel) channel).remoteAddress();\n+      return computeAddress(inetSocketAddress);\n+    } else {\n+      return null;\n+    }\n+  }\n+\n+  private static String computeAddress(InetSocketAddress inetSocketAddress) {\n+    if (inetSocketAddress != null) {\n+      val inetAddress = inetSocketAddress.getAddress();\n+      if (inetAddress != null) {\n+        return inetAddress.getHostAddress();\n+      }\n+    }\n+    return null;","path":"xio-core/src/main/java/com/xjeffrose/xio/core/SocketAddressHelper.java","position":33,"original_position":32,"commit_id":"803e21b8f4096cee6ccfafb19eaca06208ecfc8c","original_commit_id":"d1861c19e2782fe7a8dffc2e4b26517fd1a962e0","user":{"login":"khappucino","id":1757615,"avatar_url":"https://avatars3.githubusercontent.com/u/1757615?v=4","gravatar_id":"","url":"https://api.github.com/users/khappucino","html_url":"https://github.com/khappucino","followers_url":"https://api.github.com/users/khappucino/followers","following_url":"https://api.github.com/users/khappucino/following{/other_user}","gists_url":"https://api.github.com/users/khappucino/gists{/gist_id}","starred_url":"https://api.github.com/users/khappucino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khappucino/subscriptions","organizations_url":"https://api.github.com/users/khappucino/orgs","repos_url":"https://api.github.com/users/khappucino/repos","events_url":"https://api.github.com/users/khappucino/events{/privacy}","received_events_url":"https://api.github.com/users/khappucino/received_events","type":"User","site_admin":false},"body":"after speaking with pdex, will hold on this change because of rabbit holes","created_at":"2018-03-16T23:47:42Z","updated_at":"2018-03-16T23:47:42Z","html_url":"https://github.com/xjdr/xio/pull/182#discussion_r175237786","pull_request_url":"https://api.github.com/repos/xjdr/xio/pulls/182","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xjdr/xio/pulls/comments/175237786"},"html":{"href":"https://github.com/xjdr/xio/pull/182#discussion_r175237786"},"pull_request":{"href":"https://api.github.com/repos/xjdr/xio/pulls/182"}},"in_reply_to_id":175231668},"pull_request":{"url":"https://api.github.com/repos/xjdr/xio/pulls/182","id":175464337,"html_url":"https://github.com/xjdr/xio/pull/182","diff_url":"https://github.com/xjdr/xio/pull/182.diff","patch_url":"https://github.com/xjdr/xio/pull/182.patch","issue_url":"https://api.github.com/repos/xjdr/xio/issues/182","number":182,"state":"open","locked":false,"title":"AddedXForwardedFor to the ProxyHandler.java class. Added a helper cla…","user":{"login":"khappucino-nordstrom","id":13685022,"avatar_url":"https://avatars2.githubusercontent.com/u/13685022?v=4","gravatar_id":"","url":"https://api.github.com/users/khappucino-nordstrom","html_url":"https://github.com/khappucino-nordstrom","followers_url":"https://api.github.com/users/khappucino-nordstrom/followers","following_url":"https://api.github.com/users/khappucino-nordstrom/following{/other_user}","gists_url":"https://api.github.com/users/khappucino-nordstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/khappucino-nordstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khappucino-nordstrom/subscriptions","organizations_url":"https://api.github.com/users/khappucino-nordstrom/orgs","repos_url":"https://api.github.com/users/khappucino-nordstrom/repos","events_url":"https://api.github.com/users/khappucino-nordstrom/events{/privacy}","received_events_url":"https://api.github.com/users/khappucino-nordstrom/received_events","type":"User","site_admin":false},"body":"…ss with a static method that extracts the remote address if it can given a Channel. We are only handling SocketServerChannel and SocketChannel at the moment.","created_at":"2018-03-16T08:08:42Z","updated_at":"2018-03-16T23:47:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8efe4e7d08e7e46e04666de33676b2f912c2196","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xjdr/xio/pulls/182/commits","review_comments_url":"https://api.github.com/repos/xjdr/xio/pulls/182/comments","review_comment_url":"https://api.github.com/repos/xjdr/xio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xjdr/xio/issues/182/comments","statuses_url":"https://api.github.com/repos/xjdr/xio/statuses/803e21b8f4096cee6ccfafb19eaca06208ecfc8c","head":{"label":"khappucino:master","ref":"master","sha":"803e21b8f4096cee6ccfafb19eaca06208ecfc8c","user":{"login":"khappucino","id":1757615,"avatar_url":"https://avatars3.githubusercontent.com/u/1757615?v=4","gravatar_id":"","url":"https://api.github.com/users/khappucino","html_url":"https://github.com/khappucino","followers_url":"https://api.github.com/users/khappucino/followers","following_url":"https://api.github.com/users/khappucino/following{/other_user}","gists_url":"https://api.github.com/users/khappucino/gists{/gist_id}","starred_url":"https://api.github.com/users/khappucino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khappucino/subscriptions","organizations_url":"https://api.github.com/users/khappucino/orgs","repos_url":"https://api.github.com/users/khappucino/repos","events_url":"https://api.github.com/users/khappucino/events{/privacy}","received_events_url":"https://api.github.com/users/khappucino/received_events","type":"User","site_admin":false},"repo":{"id":125466978,"name":"xio","full_name":"khappucino/xio","owner":{"login":"khappucino","id":1757615,"avatar_url":"https://avatars3.githubusercontent.com/u/1757615?v=4","gravatar_id":"","url":"https://api.github.com/users/khappucino","html_url":"https://github.com/khappucino","followers_url":"https://api.github.com/users/khappucino/followers","following_url":"https://api.github.com/users/khappucino/following{/other_user}","gists_url":"https://api.github.com/users/khappucino/gists{/gist_id}","starred_url":"https://api.github.com/users/khappucino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khappucino/subscriptions","organizations_url":"https://api.github.com/users/khappucino/orgs","repos_url":"https://api.github.com/users/khappucino/repos","events_url":"https://api.github.com/users/khappucino/events{/privacy}","received_events_url":"https://api.github.com/users/khappucino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khappucino/xio","description":"High performance Multithreaded Async I/O for Java 8","fork":true,"url":"https://api.github.com/repos/khappucino/xio","forks_url":"https://api.github.com/repos/khappucino/xio/forks","keys_url":"https://api.github.com/repos/khappucino/xio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khappucino/xio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khappucino/xio/teams","hooks_url":"https://api.github.com/repos/khappucino/xio/hooks","issue_events_url":"https://api.github.com/repos/khappucino/xio/issues/events{/number}","events_url":"https://api.github.com/repos/khappucino/xio/events","assignees_url":"https://api.github.com/repos/khappucino/xio/assignees{/user}","branches_url":"https://api.github.com/repos/khappucino/xio/branches{/branch}","tags_url":"https://api.github.com/repos/khappucino/xio/tags","blobs_url":"https://api.github.com/repos/khappucino/xio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khappucino/xio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khappucino/xio/git/refs{/sha}","trees_url":"https://api.github.com/repos/khappucino/xio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khappucino/xio/statuses/{sha}","languages_url":"https://api.github.com/repos/khappucino/xio/languages","stargazers_url":"https://api.github.com/repos/khappucino/xio/stargazers","contributors_url":"https://api.github.com/repos/khappucino/xio/contributors","subscribers_url":"https://api.github.com/repos/khappucino/xio/subscribers","subscription_url":"https://api.github.com/repos/khappucino/xio/subscription","commits_url":"https://api.github.com/repos/khappucino/xio/commits{/sha}","git_commits_url":"https://api.github.com/repos/khappucino/xio/git/commits{/sha}","comments_url":"https://api.github.com/repos/khappucino/xio/comments{/number}","issue_comment_url":"https://api.github.com/repos/khappucino/xio/issues/comments{/number}","contents_url":"https://api.github.com/repos/khappucino/xio/contents/{+path}","compare_url":"https://api.github.com/repos/khappucino/xio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khappucino/xio/merges","archive_url":"https://api.github.com/repos/khappucino/xio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khappucino/xio/downloads","issues_url":"https://api.github.com/repos/khappucino/xio/issues{/number}","pulls_url":"https://api.github.com/repos/khappucino/xio/pulls{/number}","milestones_url":"https://api.github.com/repos/khappucino/xio/milestones{/number}","notifications_url":"https://api.github.com/repos/khappucino/xio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khappucino/xio/labels{/name}","releases_url":"https://api.github.com/repos/khappucino/xio/releases{/id}","deployments_url":"https://api.github.com/repos/khappucino/xio/deployments","created_at":"2018-03-16T05:16:08Z","updated_at":"2018-03-16T23:46:45Z","pushed_at":"2018-03-16T23:46:43Z","git_url":"git://github.com/khappucino/xio.git","ssh_url":"git@github.com:khappucino/xio.git","clone_url":"https://github.com/khappucino/xio.git","svn_url":"https://github.com/khappucino/xio","homepage":null,"size":28555,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xjdr:master","ref":"master","sha":"6108d9d704fc42378185ea06ebb1c27036b21c9f","user":{"login":"xjdr","id":2508631,"avatar_url":"https://avatars3.githubusercontent.com/u/2508631?v=4","gravatar_id":"","url":"https://api.github.com/users/xjdr","html_url":"https://github.com/xjdr","followers_url":"https://api.github.com/users/xjdr/followers","following_url":"https://api.github.com/users/xjdr/following{/other_user}","gists_url":"https://api.github.com/users/xjdr/gists{/gist_id}","starred_url":"https://api.github.com/users/xjdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xjdr/subscriptions","organizations_url":"https://api.github.com/users/xjdr/orgs","repos_url":"https://api.github.com/users/xjdr/repos","events_url":"https://api.github.com/users/xjdr/events{/privacy}","received_events_url":"https://api.github.com/users/xjdr/received_events","type":"User","site_admin":false},"repo":{"id":27653357,"name":"xio","full_name":"xjdr/xio","owner":{"login":"xjdr","id":2508631,"avatar_url":"https://avatars3.githubusercontent.com/u/2508631?v=4","gravatar_id":"","url":"https://api.github.com/users/xjdr","html_url":"https://github.com/xjdr","followers_url":"https://api.github.com/users/xjdr/followers","following_url":"https://api.github.com/users/xjdr/following{/other_user}","gists_url":"https://api.github.com/users/xjdr/gists{/gist_id}","starred_url":"https://api.github.com/users/xjdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xjdr/subscriptions","organizations_url":"https://api.github.com/users/xjdr/orgs","repos_url":"https://api.github.com/users/xjdr/repos","events_url":"https://api.github.com/users/xjdr/events{/privacy}","received_events_url":"https://api.github.com/users/xjdr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xjdr/xio","description":"High performance Multithreaded Async I/O for Java 8","fork":false,"url":"https://api.github.com/repos/xjdr/xio","forks_url":"https://api.github.com/repos/xjdr/xio/forks","keys_url":"https://api.github.com/repos/xjdr/xio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xjdr/xio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xjdr/xio/teams","hooks_url":"https://api.github.com/repos/xjdr/xio/hooks","issue_events_url":"https://api.github.com/repos/xjdr/xio/issues/events{/number}","events_url":"https://api.github.com/repos/xjdr/xio/events","assignees_url":"https://api.github.com/repos/xjdr/xio/assignees{/user}","branches_url":"https://api.github.com/repos/xjdr/xio/branches{/branch}","tags_url":"https://api.github.com/repos/xjdr/xio/tags","blobs_url":"https://api.github.com/repos/xjdr/xio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xjdr/xio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xjdr/xio/git/refs{/sha}","trees_url":"https://api.github.com/repos/xjdr/xio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xjdr/xio/statuses/{sha}","languages_url":"https://api.github.com/repos/xjdr/xio/languages","stargazers_url":"https://api.github.com/repos/xjdr/xio/stargazers","contributors_url":"https://api.github.com/repos/xjdr/xio/contributors","subscribers_url":"https://api.github.com/repos/xjdr/xio/subscribers","subscription_url":"https://api.github.com/repos/xjdr/xio/subscription","commits_url":"https://api.github.com/repos/xjdr/xio/commits{/sha}","git_commits_url":"https://api.github.com/repos/xjdr/xio/git/commits{/sha}","comments_url":"https://api.github.com/repos/xjdr/xio/comments{/number}","issue_comment_url":"https://api.github.com/repos/xjdr/xio/issues/comments{/number}","contents_url":"https://api.github.com/repos/xjdr/xio/contents/{+path}","compare_url":"https://api.github.com/repos/xjdr/xio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xjdr/xio/merges","archive_url":"https://api.github.com/repos/xjdr/xio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xjdr/xio/downloads","issues_url":"https://api.github.com/repos/xjdr/xio/issues{/number}","pulls_url":"https://api.github.com/repos/xjdr/xio/pulls{/number}","milestones_url":"https://api.github.com/repos/xjdr/xio/milestones{/number}","notifications_url":"https://api.github.com/repos/xjdr/xio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xjdr/xio/labels{/name}","releases_url":"https://api.github.com/repos/xjdr/xio/releases{/id}","deployments_url":"https://api.github.com/repos/xjdr/xio/deployments","created_at":"2014-12-06T23:51:21Z","updated_at":"2018-03-15T17:56:07Z","pushed_at":"2018-03-16T23:46:45Z","git_url":"git://github.com/xjdr/xio.git","ssh_url":"git@github.com:xjdr/xio.git","clone_url":"https://github.com/xjdr/xio.git","svn_url":"https://github.com/xjdr/xio","homepage":null,"size":28553,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":19,"open_issues":8,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xjdr/xio/pulls/182"},"html":{"href":"https://github.com/xjdr/xio/pull/182"},"issue":{"href":"https://api.github.com/repos/xjdr/xio/issues/182"},"comments":{"href":"https://api.github.com/repos/xjdr/xio/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/xjdr/xio/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/xjdr/xio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xjdr/xio/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/xjdr/xio/statuses/803e21b8f4096cee6ccfafb19eaca06208ecfc8c"}},"author_association":"NONE"}}
{"actor":{"display_login":"khappucino"}}