{"action":"created","comment":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/comments/34517483","id":34517483,"diff_hunk":"@@ -241,6 +241,23 @@ def make(klass, s, loc, toks):\n     def __call__(self, f):\n         return re.search(self.expr, f.request.url)\n \n+class FSrc(_Rex):\n+    code = \"src\"\n+    help = \"Match source address\"\n+\n+    def __call__(self, f):\n+        return f.client_conn and re.search(self.expr, repr(f.client_conn.address))\n+\n+class _Int(_Action):","path":"libmproxy/filt.py","position":11,"original_position":11,"commit_id":"1cfe29cbbfb5e4f438d41df7b9ba4dbfa064b50c","original_commit_id":"1cfe29cbbfb5e4f438d41df7b9ba4dbfa064b50c","user":{"login":"mhils","id":1019198,"avatar_url":"https://avatars.githubusercontent.com/u/1019198?v=3","gravatar_id":"","url":"https://api.github.com/users/mhils","html_url":"https://github.com/mhils","followers_url":"https://api.github.com/users/mhils/followers","following_url":"https://api.github.com/users/mhils/following{/other_user}","gists_url":"https://api.github.com/users/mhils/gists{/gist_id}","starred_url":"https://api.github.com/users/mhils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhils/subscriptions","organizations_url":"https://api.github.com/users/mhils/orgs","repos_url":"https://api.github.com/users/mhils/repos","events_url":"https://api.github.com/users/mhils/events{/privacy}","received_events_url":"https://api.github.com/users/mhils/received_events","type":"User","site_admin":false},"body":"dupe?","created_at":"2015-07-13T22:03:27Z","updated_at":"2015-07-13T22:03:27Z","html_url":"https://github.com/mitmproxy/mitmproxy/pull/676#discussion_r34517483","pull_request_url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676","_links":{"self":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/comments/34517483"},"html":{"href":"https://github.com/mitmproxy/mitmproxy/pull/676#discussion_r34517483"},"pull_request":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676"}}},"pull_request":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676","id":39859247,"html_url":"https://github.com/mitmproxy/mitmproxy/pull/676","diff_url":"https://github.com/mitmproxy/mitmproxy/pull/676.diff","patch_url":"https://github.com/mitmproxy/mitmproxy/pull/676.patch","issue_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/676","number":676,"state":"open","locked":false,"title":"Add source address filter","user":{"login":"isra17","id":1420974,"avatar_url":"https://avatars.githubusercontent.com/u/1420974?v=3","gravatar_id":"","url":"https://api.github.com/users/isra17","html_url":"https://github.com/isra17","followers_url":"https://api.github.com/users/isra17/followers","following_url":"https://api.github.com/users/isra17/following{/other_user}","gists_url":"https://api.github.com/users/isra17/gists{/gist_id}","starred_url":"https://api.github.com/users/isra17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isra17/subscriptions","organizations_url":"https://api.github.com/users/isra17/orgs","repos_url":"https://api.github.com/users/isra17/repos","events_url":"https://api.github.com/users/isra17/events{/privacy}","received_events_url":"https://api.github.com/users/isra17/received_events","type":"User","site_admin":false},"body":"This filter allow to match on the request source and destination addresses in the form\r\nof `<IP>:<Port>` with `~src` and `~dst`.\r\nEx:\r\n\r\n  * Match client IP: `~src 192.168.0.123`\r\n  * Match source subnet: `~src 192.168.0.*`\r\n  * Match port: `~dst :8080`\r\n\r\nAlso fixed the parsing grammar to add a `WordEnd` after each filter\r\nname. That way, `~src` doesn't match `~s` instead and keep the behavior\r\nconsistent with `~hq` != `~h`.\r\n\r\nAn alternative, which look betters IMO, but isn't consistent with the others filter name would be using name such as:\r\n\r\n * `~src.ip`\r\n * `~src.port`\r\n\r\nThis look similar to Wireshark notation and could be extended to other filter such as `~request.headers.host google.com` which might look better and be easier to remember than `~hq 'host.*google.com'`.","created_at":"2015-07-13T21:34:54Z","updated_at":"2015-07-13T22:03:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0380afd50f7bda1bc318e45a734f0e8c56a4bcac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676/commits","review_comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676/comments","review_comment_url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/676/comments","statuses_url":"https://api.github.com/repos/mitmproxy/mitmproxy/statuses/1cfe29cbbfb5e4f438d41df7b9ba4dbfa064b50c","head":{"label":"isra17:master","ref":"master","sha":"1cfe29cbbfb5e4f438d41df7b9ba4dbfa064b50c","user":{"login":"isra17","id":1420974,"avatar_url":"https://avatars.githubusercontent.com/u/1420974?v=3","gravatar_id":"","url":"https://api.github.com/users/isra17","html_url":"https://github.com/isra17","followers_url":"https://api.github.com/users/isra17/followers","following_url":"https://api.github.com/users/isra17/following{/other_user}","gists_url":"https://api.github.com/users/isra17/gists{/gist_id}","starred_url":"https://api.github.com/users/isra17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isra17/subscriptions","organizations_url":"https://api.github.com/users/isra17/orgs","repos_url":"https://api.github.com/users/isra17/repos","events_url":"https://api.github.com/users/isra17/events{/privacy}","received_events_url":"https://api.github.com/users/isra17/received_events","type":"User","site_admin":false},"repo":{"id":39037247,"name":"mitmproxy","full_name":"isra17/mitmproxy","owner":{"login":"isra17","id":1420974,"avatar_url":"https://avatars.githubusercontent.com/u/1420974?v=3","gravatar_id":"","url":"https://api.github.com/users/isra17","html_url":"https://github.com/isra17","followers_url":"https://api.github.com/users/isra17/followers","following_url":"https://api.github.com/users/isra17/following{/other_user}","gists_url":"https://api.github.com/users/isra17/gists{/gist_id}","starred_url":"https://api.github.com/users/isra17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isra17/subscriptions","organizations_url":"https://api.github.com/users/isra17/orgs","repos_url":"https://api.github.com/users/isra17/repos","events_url":"https://api.github.com/users/isra17/events{/privacy}","received_events_url":"https://api.github.com/users/isra17/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isra17/mitmproxy","description":"An interactive SSL-capable intercepting HTTP proxy for penetration testers and software developers","fork":true,"url":"https://api.github.com/repos/isra17/mitmproxy","forks_url":"https://api.github.com/repos/isra17/mitmproxy/forks","keys_url":"https://api.github.com/repos/isra17/mitmproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isra17/mitmproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isra17/mitmproxy/teams","hooks_url":"https://api.github.com/repos/isra17/mitmproxy/hooks","issue_events_url":"https://api.github.com/repos/isra17/mitmproxy/issues/events{/number}","events_url":"https://api.github.com/repos/isra17/mitmproxy/events","assignees_url":"https://api.github.com/repos/isra17/mitmproxy/assignees{/user}","branches_url":"https://api.github.com/repos/isra17/mitmproxy/branches{/branch}","tags_url":"https://api.github.com/repos/isra17/mitmproxy/tags","blobs_url":"https://api.github.com/repos/isra17/mitmproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isra17/mitmproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isra17/mitmproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/isra17/mitmproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isra17/mitmproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/isra17/mitmproxy/languages","stargazers_url":"https://api.github.com/repos/isra17/mitmproxy/stargazers","contributors_url":"https://api.github.com/repos/isra17/mitmproxy/contributors","subscribers_url":"https://api.github.com/repos/isra17/mitmproxy/subscribers","subscription_url":"https://api.github.com/repos/isra17/mitmproxy/subscription","commits_url":"https://api.github.com/repos/isra17/mitmproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/isra17/mitmproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/isra17/mitmproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/isra17/mitmproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/isra17/mitmproxy/contents/{+path}","compare_url":"https://api.github.com/repos/isra17/mitmproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isra17/mitmproxy/merges","archive_url":"https://api.github.com/repos/isra17/mitmproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isra17/mitmproxy/downloads","issues_url":"https://api.github.com/repos/isra17/mitmproxy/issues{/number}","pulls_url":"https://api.github.com/repos/isra17/mitmproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/isra17/mitmproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/isra17/mitmproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isra17/mitmproxy/labels{/name}","releases_url":"https://api.github.com/repos/isra17/mitmproxy/releases{/id}","created_at":"2015-07-13T21:04:25Z","updated_at":"2015-07-13T21:04:26Z","pushed_at":"2015-07-13T21:33:35Z","git_url":"git://github.com/isra17/mitmproxy.git","ssh_url":"git@github.com:isra17/mitmproxy.git","clone_url":"https://github.com/isra17/mitmproxy.git","svn_url":"https://github.com/isra17/mitmproxy","homepage":"http://mitmproxy.org","size":27246,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"mitmproxy:master","ref":"master","sha":"2af2e60f1f2eea4e887bda69aea19a82f951a78f","user":{"login":"mitmproxy","id":4652787,"avatar_url":"https://avatars.githubusercontent.com/u/4652787?v=3","gravatar_id":"","url":"https://api.github.com/users/mitmproxy","html_url":"https://github.com/mitmproxy","followers_url":"https://api.github.com/users/mitmproxy/followers","following_url":"https://api.github.com/users/mitmproxy/following{/other_user}","gists_url":"https://api.github.com/users/mitmproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/mitmproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitmproxy/subscriptions","organizations_url":"https://api.github.com/users/mitmproxy/orgs","repos_url":"https://api.github.com/users/mitmproxy/repos","events_url":"https://api.github.com/users/mitmproxy/events{/privacy}","received_events_url":"https://api.github.com/users/mitmproxy/received_events","type":"Organization","site_admin":false},"repo":{"id":519832,"name":"mitmproxy","full_name":"mitmproxy/mitmproxy","owner":{"login":"mitmproxy","id":4652787,"avatar_url":"https://avatars.githubusercontent.com/u/4652787?v=3","gravatar_id":"","url":"https://api.github.com/users/mitmproxy","html_url":"https://github.com/mitmproxy","followers_url":"https://api.github.com/users/mitmproxy/followers","following_url":"https://api.github.com/users/mitmproxy/following{/other_user}","gists_url":"https://api.github.com/users/mitmproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/mitmproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitmproxy/subscriptions","organizations_url":"https://api.github.com/users/mitmproxy/orgs","repos_url":"https://api.github.com/users/mitmproxy/repos","events_url":"https://api.github.com/users/mitmproxy/events{/privacy}","received_events_url":"https://api.github.com/users/mitmproxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mitmproxy/mitmproxy","description":"An interactive SSL-capable intercepting HTTP proxy for penetration testers and software developers","fork":false,"url":"https://api.github.com/repos/mitmproxy/mitmproxy","forks_url":"https://api.github.com/repos/mitmproxy/mitmproxy/forks","keys_url":"https://api.github.com/repos/mitmproxy/mitmproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitmproxy/mitmproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitmproxy/mitmproxy/teams","hooks_url":"https://api.github.com/repos/mitmproxy/mitmproxy/hooks","issue_events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/events{/number}","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/events","assignees_url":"https://api.github.com/repos/mitmproxy/mitmproxy/assignees{/user}","branches_url":"https://api.github.com/repos/mitmproxy/mitmproxy/branches{/branch}","tags_url":"https://api.github.com/repos/mitmproxy/mitmproxy/tags","blobs_url":"https://api.github.com/repos/mitmproxy/mitmproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitmproxy/mitmproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitmproxy/mitmproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitmproxy/mitmproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitmproxy/mitmproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/mitmproxy/mitmproxy/languages","stargazers_url":"https://api.github.com/repos/mitmproxy/mitmproxy/stargazers","contributors_url":"https://api.github.com/repos/mitmproxy/mitmproxy/contributors","subscribers_url":"https://api.github.com/repos/mitmproxy/mitmproxy/subscribers","subscription_url":"https://api.github.com/repos/mitmproxy/mitmproxy/subscription","commits_url":"https://api.github.com/repos/mitmproxy/mitmproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitmproxy/mitmproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitmproxy/mitmproxy/contents/{+path}","compare_url":"https://api.github.com/repos/mitmproxy/mitmproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitmproxy/mitmproxy/merges","archive_url":"https://api.github.com/repos/mitmproxy/mitmproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitmproxy/mitmproxy/downloads","issues_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues{/number}","pulls_url":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/mitmproxy/mitmproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/mitmproxy/mitmproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels{/name}","releases_url":"https://api.github.com/repos/mitmproxy/mitmproxy/releases{/id}","created_at":"2010-02-16T04:10:13Z","updated_at":"2015-07-13T16:52:45Z","pushed_at":"2015-07-13T21:34:55Z","git_url":"git://github.com/mitmproxy/mitmproxy.git","ssh_url":"git@github.com:mitmproxy/mitmproxy.git","clone_url":"https://github.com/mitmproxy/mitmproxy.git","svn_url":"https://github.com/mitmproxy/mitmproxy","homepage":"http://mitmproxy.org","size":27246,"stargazers_count":3551,"watchers_count":3551,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":456,"mirror_url":null,"open_issues_count":53,"forks":456,"open_issues":53,"watchers":3551,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676"},"html":{"href":"https://github.com/mitmproxy/mitmproxy/pull/676"},"issue":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/676"},"comments":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/676/comments"},"review_comments":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676/comments"},"review_comment":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/pulls/676/commits"},"statuses":{"href":"https://api.github.com/repos/mitmproxy/mitmproxy/statuses/1cfe29cbbfb5e4f438d41df7b9ba4dbfa064b50c"}}}}