[swift-server-dev] HTTP Parser

Philippe Hausler phausler at apple.com
Fri Nov 4 15:55:07 CDT 2016


I think it is pretty reasonable for us to modify URLRequest or HTTPURLResponse. That being said it would need to be well encapsulated, most likely limited to primarily swift, it couldn’t break existing clients on iOS or macOS etc. Extensions might be a great way to add that functionality. For a full addition we would need to of course go through full API proposals and such and most likely have some rough draft of the implementation before the proposal stage as well.

> On Nov 4, 2016, at 1:34 PM, Brent Royal-Gordon via swift-server-dev <swift-server-dev at swift.org> wrote:
> 
>> 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
> 
> _______________________________________________
> swift-server-dev mailing list
> swift-server-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-server-dev



More information about the swift-server-dev mailing list