{"action":"closed","issue":{"url":"https://api.github.com/repos/reactphp/socket/issues/41","repository_url":"https://api.github.com/repos/reactphp/socket","labels_url":"https://api.github.com/repos/reactphp/socket/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/reactphp/socket/issues/41/comments","events_url":"https://api.github.com/repos/reactphp/socket/issues/41/events","html_url":"https://github.com/reactphp/socket/issues/41","id":159146839,"number":41,"title":"Extend ConnectionInterface with ports / target address.","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-08T12:03:05Z","updated_at":"2016-07-13T11:29:58Z","closed_at":"2016-07-13T11:29:57Z","body":"(Related to #26)\r\n\r\nI'm implementing the proxy protocol for react:\r\nhttp://www.haproxy.org/download/1.5/doc/proxy-protocol.txt\r\n\r\nEven though not all transports have a separate port part, I think it would be nice to add some more methods to the connection interface:\r\n````\r\npublic function getTargetAddress();\r\npublic function getTargetPort();\r\npublic function getRemotePort();\r\n````\r\n\r\n-- Part below is about the naming of entities in the connection interface --\r\n\r\nAlso naming could possibly be reconsidered. Connections always have a direction (source and target), but the concept of local and remote does not always apply. I understand that `getRemoteAddress()` refers to the \"other\" end of the connection, but it could be more consistent when we use source and target.\r\nWhen looking at it from a more abstract viewpoint:\r\n\r\nConsider: \r\nClient `A` connects to Server `B` to establish a Connection `C`\r\nBoth `A` and `B` both have an object representing C, say C_a and `C_b`\r\nUsing terms like `remoteAddress` and `localAddress` creates the following relation:\r\n````\r\nC_a.remoteAddress = C_b.localAddress \r\nand \r\nC_a.localAddress = C_b.remoteAddress\r\n````\r\nWhen multiple connections are managed, both inbound and outbound, we need to \"know\" where the connection came from to decide which party we are (local or remote). \r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"SamMousa"}}