{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments/192410373","pull_request_review_id":125185848,"id":192410373,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjQxMDM3Mw==","diff_hunk":"@@ -53,49 +56,115 @@ are refined`,\n \t},\n \n \tSubcommands: map[string]*cmds.Command{\n-\t\t\"listener\": p2pListenerCmd,\n-\t\t\"stream\":   p2pStreamCmd,\n+\t\t\"stream\": p2pStreamCmd,\n+\n+\t\t\"forward\": p2pForwardCmd,\n+\t\t\"close\":   p2pCloseCmd,\n+\t\t\"ls\":      p2pLsCmd,\n \t},\n }\n \n-// p2pListenerCmd is the 'ipfs p2p listener' command\n-var p2pListenerCmd = &cmds.Command{\n+var p2pForwardCmd = &cmds.Command{\n \tHelptext: cmdkit.HelpText{\n-\t\tTagline:          \"P2P listener management.\",\n-\t\tShortDescription: \"Create and manage listener p2p endpoints\",\n+\t\tTagline: \"Forward connections to or from libp2p services\",\n+\t\tShortDescription: `\n+Forward connections to <listen-address> to <target-address>. Protocol specifies\n+the libp2p protocol to use.\n+\n+To create libp2p service listener, specify '/ipfs' as <listen-address>\n+\n+Examples:\n+  ipfs p2p forward myproto /ipfs /ip4/127.0.0.1/tcp/1234\n+    - Forward connections to 'myproto' libp2p service to 127.0.0.1:1234\n+\n+  ipfs p2p forward myproto /ip4/127.0.0.1/tcp/4567 /ipfs/QmPeer\n+    - Forward connections to 127.0.0.1:4567 to 'myproto' service on /ipfs/QmPeer\n+\n+`,\n \t},\n+\tArguments: []cmdkit.Argument{\n+\t\tcmdkit.StringArg(\"protocol\", true, false, \"Protocol identifier.\"),\n+\t\tcmdkit.StringArg(\"listen-address\", true, false, \"Listening endpoint\"),\n+\t\tcmdkit.StringArg(\"target-address\", true, false, \"Target endpoint.\"),\n+\t},\n+\tRun: func(req cmds.Request, res cmds.Response) {\n+\t\tn, err := p2pGetNode(req)\n+\t\tif err != nil {\n+\t\t\tres.SetError(err, cmdkit.ErrNormal)\n+\t\t\treturn\n+\t\t}\n \n-\tSubcommands: map[string]*cmds.Command{\n-\t\t\"ls\":    p2pListenerLsCmd,\n-\t\t\"open\":  p2pListenerListenCmd,\n-\t\t\"close\": p2pListenerCloseCmd,\n+\t\t//TODO: Do we really want/need implicit prefix?","path":"core/commands/p2p.go","position":95,"original_position":95,"commit_id":"768d2a0f4e67e5fc777e44935e1a842ed8595a8c","original_commit_id":"768d2a0f4e67e5fc777e44935e1a842ed8595a8c","user":{"login":"djdv","id":13862850,"node_id":"MDQ6VXNlcjEzODYyODUw","avatar_url":"https://avatars1.githubusercontent.com/u/13862850?v=4","gravatar_id":"","url":"https://api.github.com/users/djdv","html_url":"https://github.com/djdv","followers_url":"https://api.github.com/users/djdv/followers","following_url":"https://api.github.com/users/djdv/following{/other_user}","gists_url":"https://api.github.com/users/djdv/gists{/gist_id}","starred_url":"https://api.github.com/users/djdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djdv/subscriptions","organizations_url":"https://api.github.com/users/djdv/orgs","repos_url":"https://api.github.com/users/djdv/repos","events_url":"https://api.github.com/users/djdv/events{/privacy}","received_events_url":"https://api.github.com/users/djdv/received_events","type":"User","site_admin":false},"body":"Thoughts on this?\r\nWould it cause any restrictions or confusion, with or without them?","created_at":"2018-06-01T14:17:58Z","updated_at":"2018-06-01T14:17:59Z","html_url":"https://github.com/ipfs/go-ipfs/pull/4929#discussion_r192410373","pull_request_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments/192410373"},"html":{"href":"https://github.com/ipfs/go-ipfs/pull/4929#discussion_r192410373"},"pull_request":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929","id":180591578,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgwNTkxNTc4","html_url":"https://github.com/ipfs/go-ipfs/pull/4929","diff_url":"https://github.com/ipfs/go-ipfs/pull/4929.diff","patch_url":"https://github.com/ipfs/go-ipfs/pull/4929.patch","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4929","number":4929,"state":"open","locked":false,"title":"Refactor `ipfs p2p`","user":{"login":"magik6k","id":3867941,"node_id":"MDQ6VXNlcjM4Njc5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/3867941?v=4","gravatar_id":"","url":"https://api.github.com/users/magik6k","html_url":"https://github.com/magik6k","followers_url":"https://api.github.com/users/magik6k/followers","following_url":"https://api.github.com/users/magik6k/following{/other_user}","gists_url":"https://api.github.com/users/magik6k/gists{/gist_id}","starred_url":"https://api.github.com/users/magik6k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magik6k/subscriptions","organizations_url":"https://api.github.com/users/magik6k/orgs","repos_url":"https://api.github.com/users/magik6k/repos","events_url":"https://api.github.com/users/magik6k/events{/privacy}","received_events_url":"https://api.github.com/users/magik6k/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/ipfs/go-ipfs/issues/4895.\r\n\r\nTODO:\r\n* [x] Reorganize the code\r\n* [x] Fix/Cleanup registry logic\r\n* [x] Make dial work more like `ssh -L` \r\n* [x] Update docs","created_at":"2018-04-10T12:51:36Z","updated_at":"2018-06-01T14:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45f124a13418d32809e53c61e97483d3f3c591ab","assignee":{"login":"magik6k","id":3867941,"node_id":"MDQ6VXNlcjM4Njc5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/3867941?v=4","gravatar_id":"","url":"https://api.github.com/users/magik6k","html_url":"https://github.com/magik6k","followers_url":"https://api.github.com/users/magik6k/followers","following_url":"https://api.github.com/users/magik6k/following{/other_user}","gists_url":"https://api.github.com/users/magik6k/gists{/gist_id}","starred_url":"https://api.github.com/users/magik6k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magik6k/subscriptions","organizations_url":"https://api.github.com/users/magik6k/orgs","repos_url":"https://api.github.com/users/magik6k/repos","events_url":"https://api.github.com/users/magik6k/events{/privacy}","received_events_url":"https://api.github.com/users/magik6k/received_events","type":"User","site_admin":false},"assignees":[{"login":"magik6k","id":3867941,"node_id":"MDQ6VXNlcjM4Njc5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/3867941?v=4","gravatar_id":"","url":"https://api.github.com/users/magik6k","html_url":"https://github.com/magik6k","followers_url":"https://api.github.com/users/magik6k/followers","following_url":"https://api.github.com/users/magik6k/following{/other_user}","gists_url":"https://api.github.com/users/magik6k/gists{/gist_id}","starred_url":"https://api.github.com/users/magik6k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magik6k/subscriptions","organizations_url":"https://api.github.com/users/magik6k/orgs","repos_url":"https://api.github.com/users/magik6k/repos","events_url":"https://api.github.com/users/magik6k/events{/privacy}","received_events_url":"https://api.github.com/users/magik6k/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"Kubuxu","id":2259282,"node_id":"MDQ6VXNlcjIyNTkyODI=","avatar_url":"https://avatars3.githubusercontent.com/u/2259282?v=4","gravatar_id":"","url":"https://api.github.com/users/Kubuxu","html_url":"https://github.com/Kubuxu","followers_url":"https://api.github.com/users/Kubuxu/followers","following_url":"https://api.github.com/users/Kubuxu/following{/other_user}","gists_url":"https://api.github.com/users/Kubuxu/gists{/gist_id}","starred_url":"https://api.github.com/users/Kubuxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kubuxu/subscriptions","organizations_url":"https://api.github.com/users/Kubuxu/orgs","repos_url":"https://api.github.com/users/Kubuxu/repos","events_url":"https://api.github.com/users/Kubuxu/events{/privacy}","received_events_url":"https://api.github.com/users/Kubuxu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":129070658,"node_id":"MDU6TGFiZWwxMjkwNzA2NTg=","url":"https://api.github.com/repos/ipfs/go-ipfs/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929/commits","review_comments_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929/comments","review_comment_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4929/comments","statuses_url":"https://api.github.com/repos/ipfs/go-ipfs/statuses/768d2a0f4e67e5fc777e44935e1a842ed8595a8c","head":{"label":"ipfs:misc/cleanup-p2p","ref":"misc/cleanup-p2p","sha":"768d2a0f4e67e5fc777e44935e1a842ed8595a8c","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":21233191,"node_id":"MDEwOlJlcG9zaXRvcnkyMTIzMzE5MQ==","name":"go-ipfs","full_name":"ipfs/go-ipfs","owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-ipfs","description":"IPFS implementation in Go","fork":false,"url":"https://api.github.com/repos/ipfs/go-ipfs","forks_url":"https://api.github.com/repos/ipfs/go-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-ipfs/deployments","created_at":"2014-06-26T08:14:34Z","updated_at":"2018-06-01T14:09:51Z","pushed_at":"2018-06-01T11:56:08Z","git_url":"git://github.com/ipfs/go-ipfs.git","ssh_url":"git@github.com:ipfs/go-ipfs.git","clone_url":"https://github.com/ipfs/go-ipfs.git","svn_url":"https://github.com/ipfs/go-ipfs","homepage":"https://ipfs.io","size":30180,"stargazers_count":5677,"watchers_count":5677,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":996,"mirror_url":null,"archived":false,"open_issues_count":948,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":996,"open_issues":948,"watchers":5677,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"2ba717994ecedb76c7650f0c0d15537435332291","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":21233191,"node_id":"MDEwOlJlcG9zaXRvcnkyMTIzMzE5MQ==","name":"go-ipfs","full_name":"ipfs/go-ipfs","owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-ipfs","description":"IPFS implementation in Go","fork":false,"url":"https://api.github.com/repos/ipfs/go-ipfs","forks_url":"https://api.github.com/repos/ipfs/go-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-ipfs/deployments","created_at":"2014-06-26T08:14:34Z","updated_at":"2018-06-01T14:09:51Z","pushed_at":"2018-06-01T11:56:08Z","git_url":"git://github.com/ipfs/go-ipfs.git","ssh_url":"git@github.com:ipfs/go-ipfs.git","clone_url":"https://github.com/ipfs/go-ipfs.git","svn_url":"https://github.com/ipfs/go-ipfs","homepage":"https://ipfs.io","size":30180,"stargazers_count":5677,"watchers_count":5677,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":996,"mirror_url":null,"archived":false,"open_issues_count":948,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":996,"open_issues":948,"watchers":5677,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929"},"html":{"href":"https://github.com/ipfs/go-ipfs/pull/4929"},"issue":{"href":"https://api.github.com/repos/ipfs/go-ipfs/issues/4929"},"comments":{"href":"https://api.github.com/repos/ipfs/go-ipfs/issues/4929/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/go-ipfs/pulls/4929/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/go-ipfs/statuses/768d2a0f4e67e5fc777e44935e1a842ed8595a8c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"djdv"}}