Skip to content
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

Productize ManagedHandler for HttpClient #22470

Closed
4 of 15 tasks
stephentoub opened this issue Jun 23, 2017 · 12 comments
Closed
4 of 15 tasks

Productize ManagedHandler for HttpClient #22470

stephentoub opened this issue Jun 23, 2017 · 12 comments
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@stephentoub
Copy link
Member

We've checked in a prototype C# implementation of an HttpClientHandler. But there's lots of work left to do on it.

  • Get all existing tests passing.
  • Add lots of additional protocol-related tests
  • Add support for digest auth
  • Add support for NTLM auth
  • Add support for Negotiate auth
  • Add better connection pooling support
  • Add HTTP/2 support
  • Add support for environment variables recognized by existing handlers
  • Lots of fit and finish
  • Perf
  • Perf
  • Perf
  • Perf
  • ... you get the idea
  • Determine if/how it should be shipped initially
@stephentoub
Copy link
Member Author

cc: @geoffkizer, @Priya91

@clairernovotny
Copy link
Member

One thing I would like to see/ensure is that the HttpClient instance can play nicely with external diagnostic tools like Fiddler and Visual Studio's network debug trace diagnostics. The current .NET Core one on Windows requires hoops like changing the hostname called to localhost.fiddler in order to see the traces.

@stephentoub
Copy link
Member Author

Thanks, @onovotny. Do you know what it is about WinHttp or WinHttpHandler that causes that not to be the case? Is it something that can be fixed in WinHttpHandler as well, or is it specific to the lower-level?

@clairernovotny
Copy link
Member

I'm not 100% sure, but I believe it doesn't respect the default proxy setting if the hostname is localhost

@karelz
Copy link
Member

karelz commented Jun 23, 2017

@onovotny this is the Networking stack proposal I sent to bunch of you couple of months ago. I didn't get time to publish it publicly on dotnet/designs repo, something I plan to finally fix this weekend.

We can provide additional info bout our current execution plan, but the high-level idea is still the same ...

@karelz
Copy link
Member

karelz commented Jun 23, 2017

Moving to Future as some parts will likely not make it into 2.1. We are still debating which parts. It heavily depends on funding available and how much we will have to invest in other Networking asks (ALPN, Faster SslStream and Sockets perf on Linux for Kestrel)

@Matthias247
Copy link

Matthias247 commented Jun 25, 2017

Regarding

  • Add HTTP/2 support

As some of you might be aware of I have implemented a fully managed HTTP/2 library, which allows clients and servers to be built on top of it. All basic client and server features should be working and it has a really big test coverage. Secure HTTP/2 (h2) and the associated browser-support should be working out of the box as soon as #15813 is available.

You might want to check out if you can use it (or parts of it) for your work. Unfortunately I currently don't have time to investigate how exactly your HTTP/1 implementation works and what the integration points are. But if you have questions or issues around my library just ask. You basically should need some architecture like:

+--------------+     +---------------+ 1      1 +-----------------+
| [TLS] Socket |--+--| HTTP/1 parser |----------| Request/Reponse |
+--------------+  |  +---------------+          | Abstraction     |
                  | or                          +-----------------+
                  |  +-------------------+
                  +--| HTTP/2 connection | 1  n +-----------------+
                     | state machine     |------| Request/Reponse |
                     +-------------------+      | Abstraction     |
                                                +-----------------+

which means the common parts between HTTP/1 and HTTP/2 are only the request/response abstractions and everything which is built on top of it (auth, cookies, content-enconding, etc.). But pretty much everything below it is completely different.

@karelz
Copy link
Member

karelz commented Jun 25, 2017

As promised (months ago :(), I published Networking Technical roadmap to gather further feedback from community. It describes reasoning behind our investments here and in future.

@robertmclaws
Copy link

Will this implementation fix the issues with HttpClient? Namely https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/

Thanks!

@stephentoub
Copy link
Member Author

@robertmclaws, what change are you hoping for? HttpClient's design optimizes for having fewer instances that are shared; that won't change by changing the implementation of HttpClientHandler. If you're hoping to see some additional API surface area, please open separate issue(s) with proposals for that. Thanks.

@stephentoub
Copy link
Member Author

I've opened a bunch of individual issues for known work associated with the managed handler, so I'm going to close this overall issue now.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

6 participants