Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow session to be passed in #237
In my current project I ran into an issue where I needed to proxy using https. I wasn't able to do this and after speaking with @tanner0101 he suggested the I looked into
This PR would make the
Thanks @steffendsommer, I'm glad that worked out.
For the record, the problem here was that Vapor's proxy configuration only supports requesting plaintext HTTP (non-TLS). The implementation behind this is pretty simple: we just send the request to the proxy instead, and the proxy is responsible for giving us the correct response.
However, for TLS, the problem is more involved. The whole point of TLS obviously is to prevent eavesdropping. To create a secure TLS connection, the proxy must not know the contents of the request or response. To achieve this, you need to send a special
This is something we can consider adding native stream support for in Vapor 3. However, given that URLSession works quite well we may just want to rely on that.