-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plug.Conn also has get_peer_data, which returns the original ip #32
Comments
Taking plug_cowboy as our canonical implementation, the way it works:
So ultimately, with a given I believe clobbering this value would be a bad idea. My impression is that this data is used by Cowboy to actually orchestrate the HTTP response, which is why I'm also under the impression that Phoenix LiveView relies on this "raw" data because of the low-level manipulation of sockets that it has to do. I'm unsure about those details. The general workaround for this is to pass the forwarding headers to One of the main issues people have bumped into with this is that Phoenix sockets only expose the
Given all that, I'm inclined to close this issue, since (a) I don't think we should be clobbering the raw peer data and (b) getting the right information for |
Thanks for the elaborate response!
I did not think of this, then indeed it's a bad idea. We can go ahead and close this issue. Once again, thanks for the explanation 👍 |
I realised with a LiveView project that overwriting the
remote_ip
is not enough becausePlug.Conn
has aget_peer_data
function and that's what's being called by LiveView. This value isWhat is the way forward here? Wrap the adapter implementation and wrap the
get_peer_data
to override the ip?The text was updated successfully, but these errors were encountered: