<div dir="ltr">No, assume there *is no proxy*. All I&#39;m talking about is what the webserver its self sees. Anything to do with proxies or other infrastructure really isn&#39;t WAI&#39;s place.<div><br></div><div>-davean</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 5:46 PM, Rico Moorman <span dir="ltr">&lt;<a href="mailto:rico.moorman@gmail.com" target="_blank">rico.moorman@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear Davean,<div><br></div><div>I hope that I correctly interpret your mails. I guess you are talking about connection information available at the proxy when the user makes a connection. And usually this information is passed on to the backends using special headers such as x-forwarded-for and x-forwarded-proto. Right?</div>

<div><br></div><div>Isn&#39;t this information readily available using the requestHeaders function which well, should return those headers?</div><div><br></div><div>Furthermore I would think that the application in question would be responsible to interpret the available information correctly (this would be the framework on top of e.g. warp I guess).</div>

<div><br></div><div>The framework should then provide measures to correctly generate urls/links based on this information…as in fact done by various frameworks.</div><div><br></div><div>best regards,</div><div><br></div>
<div>
Rico Moorman</div><div><div class="h5"><div><br></div><div>On Jul 24, 2013, at 12:59 PM, davean &lt;<a href="mailto:davean@xkcd.com" target="_blank">davean@xkcd.com</a>&gt; wrote:</div><div><div><br><blockquote type="cite">

<div dir="ltr">Completely not what I was saying.<div><br></div><div>&quot;<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">what IP they connected to, what port, on what interface, and even what ciphers were used ideally.&quot;</span></div>



<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><font face="arial, sans-serif">None of that is information the user could ever pass to the application except in the truly trivial cases. They&#39;re inherently features of each connection separately. If it isn&#39;t passed in the Wai Request it can&#39;t be (reasonably) discovered.</font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">If some thing is going to try to derive for the user the pre-proxy IP based the connection information it should be a library that does such preferably or alternatively a middleware component, never the webserver. Furthermore WAI should contain sufficient information in the Request object to do this and more.</font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">-davean</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 6:13 AM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think Greg and davean are saying something similar here. If I may paraphrase (please correct me if I&#39;m wrong): some information may not be derivable by the WAI handler (e.g. Warp) itself, but with a little bit of help from the user, that information could be included in the WAI standard.<div>





<br></div><div>If that&#39;s what you&#39;re getting at, I disagree. This would essentially mean we require users to provide information to Warp, so that Warp can provide that information to user applications. Warp (or any other handler) is just a dumb transport mechanism then. And since we can&#39;t rely on that information being present, we&#39;d wrap it up with Maybe values, and therefore end up losing type safety.</div>





<div><br></div><div>The prime example of all this is application root. I still strongly believe that Yesod did this the right way: if the user needs to provide the information, then ask the user to provide the information to the application itself, and the WAI handler needn&#39;t know anything about it.</div>





<div><br></div><div>Is there some kind of data that the WAI handler could do a better job of passing onto the application than the user can do?</div></div><div><div><div class="gmail_extra"><br>

<br><div class="gmail_quote">On Tue, Jul 23, 2013 at 11:58 PM, Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In Rack most of these things are known. In some cases this requires users to configure the proxy to send headers.<div>





<br></div><div>One solution would be having the user state what values are being depended on and having Warp fail on startup with an error message if it can&#39;t collect them.<br>

</div><div>It is possible to expect some of these values to not change (and require a reboot of warp when they do) and have them be part of Warp rather than WAI.</div><div><br></div><div>But just wrapping these values in a Maybe could be another approach.</div>







</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Tue, Jul 23, 2013 at 1:13 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br>







</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr">The reason we&#39;d be removing those is that there *still* isn&#39;t any way to know this. If Warp is sitting behind a reverse proxy (which is virtually always the case, whether Amazon ELB, Nginx, Keter, or something else) there&#39;s no way to know what the actual server name, server port, or scheme are.</div>







<div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 6:37 PM, Federico Mastellone <span dir="ltr">&lt;<a href="mailto:fmaste@gmail.com" target="_blank">fmaste@gmail.com</a>&gt;</span> wrote:<br>









<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hi,</div><div><br></div><div>Without isSecure and serverPort, will Applications be able to handle requests to different ports and HTTP or HTTPS in different ways? I won&#39;t be able to know if the login is made over HTTP and redirect to HTTPS with any Wai server.  </div>









<div><div><br>On 23/07/2013, at 07:04, Michael Snoyman &lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div dir="ltr">
Some of you may have seen the brief interchange between Kazu and myself regarding ResourceT in WAI. Let me give a very brief synopsis of the situation:<div>
<ul><li>In order to allow WAI applications to acquire scarce resources like file handles in an exception-safe way, WAI actions all live in a `ResourceT IO` monad, instead of just `IO`.</li>



<li>Kazu has mentioned to me in the past that, based on his profiling, monadic bind for ResourceT may currently be a bottleneck in WAI.</li><li>I made an experimental change to WAI so that, instead of actions living in `ResourceT IO`, the WAI Request value contains a ResourceT InternalState value, which can be used to accomplish the exact same thing as living in ResourceT (see [1]).</li>













<li>Kazu checked out the performance difference of this new branch, and it allows for some better optimizations.</li></ul><div>If this was purely a performance optimization, I would probably just optimize Warp and not bother changing WAI. However, I think that this change makes WAI itself better as well, and therefore am in favor of making this as a breaking change, releasing it as WAI 2.0[2]. Firstly, are there any objections to this move?</div>












<div><br></div><div>So as long as we&#39;re making a breaking change, the question arises: what other changes should we be making to WAI? I know Kazu had mentioned adding fields to avoid the need for lookups, can you clarify that request a bit? Here are some other changes I can think of:</div>












<div><ul><li>Remove the deprecated isSecure field from the Request data type.</li><li>Remove the misleading fields serverName and serverPort fields as well.</li><li>Possibly: hide the Request constructor so that new fields can be added without breaking backwards compatibility.</li>












</ul><div>If anyone else has some ideas, please bring them up.</div></div>
<div><br></div><div>[1] <a href="http://haddocks.fpcomplete.com/fp/7.4.2/20130704-120/resourcet/Control-Monad-Trans-Resource.html#g:10" target="_blank">http://haddocks.fpcomplete.com/fp/7.4.2/20130704-120/resourcet/Control-Monad-Trans-Resource.html#g:10</a></div>












<div>[2] For the Yesod community: the change is minor enough that Yesod 1.2 can have some conditional compilation to support both the current WAI 1.4 and WAI 2.0, so this shouldn&#39;t affect most Yesod users at all.</div>













</div></div>
</blockquote></div><blockquote type="cite"><span>_______________________________________________</span><br><span>web-devel mailing list</span><br><span><a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a></span><br>









<span><a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a></span><br></blockquote></div></blockquote></div><br></div><div><br></div></div></div>

<div>

-- <br>
You received this message because you are subscribed to the Google Groups &quot;Yesod Web Framework&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:yesodweb%2Bunsubscribe@googlegroups.com" target="_blank">yesodweb+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
 <br>
 <br>
</div></blockquote></div><br></div><div><div><br></div>

-- <br>
You received this message because you are subscribed to the Google Groups &quot;Yesod Web Framework&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:yesodweb%2Bunsubscribe@googlegroups.com" target="_blank">yesodweb+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
 <br>
 <br>
</div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>web-devel mailing list<br><a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>

</blockquote></div><br></div></div></div></div></blockquote></div><br></div>