-
Notifications
You must be signed in to change notification settings - Fork 838
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
Make ProxyHttpClientFactory public and extensible #869
Conversation
|
||
Log.ProxyClientCreated(_logger, context.ClusterId); | ||
|
||
return new HttpMessageInvoker(middleware, disposeHandler: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this HttpMessageInvoker
ever get disposed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there's no way of telling when it's no longer in use, except that it will get GC'd.
55938b4
to
c842d03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -52,6 +52,10 @@ public void ConfigureServices(IServiceCollection services) | |||
|
|||
services.AddReverseProxy() | |||
.LoadFromMemory(routes, clusters) | |||
.ConfigureClient((context, handler) => | |||
{ | |||
handler.Expect100ContinueTimeout = TimeSpan.FromMilliseconds(300); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expect100ContinueTimeout
or ConfigureClient
?
- ConfigureClient this lets users change basic settings without implementing a new class.
- Expect100ContinueTimeout is only used here has an example.
Fixes #805 Make ProxyHttpClientFactory public and extensible
Fixes #843 (@berhir) Enable adding HttpMessageHandler middleware (e.g. DelegatingHandler)
Contributes to #801 Allow using ProxyHttpClientFactory for direct IHttpProxy scenarios
ProxyHttpClientFactory is now public so people can:
A) Create it directly when using IHttpProxy
B) Derive from it to customize the SocketHttpHandler settings without completely re-implementing IProxyHttpClientFactory
C) Derive from it to enable wrapping SocketHttpHandler with DelegatingHandler middleware.
There's also a new extension for simple scenarios: