Closed Gazler closed 5 years ago
Sorry for the delayed response. It's a great idea, and I appreciate the PR. I'll probably want to massage around the actual implementation, both to appease my delicate sensibilities (I get weird about things 😅) and in light of possibly-changing APIs from #8. I'll try to get to this soon. 👍
In some circumstances, it is possible to get a subset of headers without the full conn. An example of this is in Phoenix sockets, where only x_headers can be fetched.
https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-shared-configuration
In this case, currently using RemoteIP involves doing something like this as conn is not available:
With this PR, someone using this library with Phoenix sockets could do: