[swift-server-dev] HTTP Parser

Brent Royal-Gordon brent at architechies.com
Fri Nov 4 15:34:39 CDT 2016


> On Nov 4, 2016, at 12:18 PM, Logan Wright via swift-server-dev <swift-server-dev at swift.org> wrote:
> 
> Helge, if I had my way, we wouldn't touch C in any way whatsoever for any of the server side libraries except as an absolute last resort, but this life is full of compromise, and I'm trying to be amicable to come up with solutions that we can agree on.
> 
> For HTTP2 as well, I'd like plans to eventually move to pure swift native implementations rethought for the language. 

I think the right solution in general is to use C quite aggressively at first, but wall it off behind Swift facades. Later, we can revisit our C dependencies and replace them with Swift as we feel it's appropriate. Ideally, we'd use protocols here so the replacement is as simple as possible.

Here's my question: Can we have our HTTP parser use Foundation's existing `URLRequest` and `HTTPURLResponse` types as Swift-facing outputs and inputs?  Or are these types too-tightly designed for an HTTP client's needs, and we need different types for an HTTP server? Or are there minor modifications the Foundation team is willing to make in Apple Foundation to extend them for our use case? If we *can* use these types on both client and server, I think that would be ideal—it would allow people to reuse their knowledge and potentially a little bit of code.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-server-dev mailing list