{"action":"created","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2771","repository_url":"https://api.github.com/repos/phoenixframework/phoenix","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2771/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2771/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2771/events","html_url":"https://github.com/phoenixframework/phoenix/pull/2771","id":299089672,"node_id":"MDExOlB1bGxSZXF1ZXN0MTcwNTU5NTM4","number":2771,"title":"Allow Websocket Transport to copy conn fields to params","user":{"login":"mobileoverlord","id":1391351,"node_id":"MDQ6VXNlcjEzOTEzNTE=","avatar_url":"https://avatars3.githubusercontent.com/u/1391351?v=4","gravatar_id":"","url":"https://api.github.com/users/mobileoverlord","html_url":"https://github.com/mobileoverlord","followers_url":"https://api.github.com/users/mobileoverlord/followers","following_url":"https://api.github.com/users/mobileoverlord/following{/other_user}","gists_url":"https://api.github.com/users/mobileoverlord/gists{/gist_id}","starred_url":"https://api.github.com/users/mobileoverlord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobileoverlord/subscriptions","organizations_url":"https://api.github.com/users/mobileoverlord/orgs","repos_url":"https://api.github.com/users/mobileoverlord/repos","events_url":"https://api.github.com/users/mobileoverlord/events{/privacy}","received_events_url":"https://api.github.com/users/mobileoverlord/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-02-21T19:03:22Z","updated_at":"2018-07-11T21:35:51Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/phoenixframework/phoenix/pulls/2771","html_url":"https://github.com/phoenixframework/phoenix/pull/2771","diff_url":"https://github.com/phoenixframework/phoenix/pull/2771.diff","patch_url":"https://github.com/phoenixframework/phoenix/pull/2771.patch"},"body":"When authenticating websockets, sometimes its necessary to have access to the headers from the initial HTTP request prior to the connection being upgraded. \r\n\r\nThe PR would allow the Websocket transport to take a list of conn fields which it would copy into the params before the websocket upgrade.\r\n\r\nFor Example, \r\n\r\n```elixir\r\n## Transports\r\n  transport :websocket, Phoenix.Transports.WebSocket, conn_fields: [:req_headers]\r\n\r\ndef connect(params, socket) do\r\n    %{req_headers: req_headers} = params\r\n    {:ok, socket}\r\n  end\r\n```"},"comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/comments/404318139","html_url":"https://github.com/phoenixframework/phoenix/pull/2771#issuecomment-404318139","issue_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2771","id":404318139,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDMxODEzOQ==","user":{"login":"bobics","id":33119,"node_id":"MDQ6VXNlcjMzMTE5","avatar_url":"https://avatars0.githubusercontent.com/u/33119?v=4","gravatar_id":"","url":"https://api.github.com/users/bobics","html_url":"https://github.com/bobics","followers_url":"https://api.github.com/users/bobics/followers","following_url":"https://api.github.com/users/bobics/following{/other_user}","gists_url":"https://api.github.com/users/bobics/gists{/gist_id}","starred_url":"https://api.github.com/users/bobics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobics/subscriptions","organizations_url":"https://api.github.com/users/bobics/orgs","repos_url":"https://api.github.com/users/bobics/repos","events_url":"https://api.github.com/users/bobics/events{/privacy}","received_events_url":"https://api.github.com/users/bobics/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T21:35:51Z","updated_at":"2018-07-11T21:35:51Z","author_association":"NONE","body":":+1: This would also be useful to us -- our use case is IP based rate limiting on join / messages (unfortunately, passing in the IP in as a message param isn't really an option since that can easily be modified)."}}
{"actor":{"display_login":"bobics"}}