add Transport override option for active health checks#6802
add Transport override option for active health checks#6802ab14-tech wants to merge 10 commits intocaddyserver:masterfrom
Conversation
|
ab14-tech seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
| // The transport to use for health checks. If not set, the handler's transport is used | ||
| Transport http.RoundTripper `json:"transport,omitempty"` | ||
|
|
There was a problem hiding this comment.
Accepting the PR is something to be discussed, but this isn't how to implement custom transport. See here for how it's done in the reverse proxy handler:
There was a problem hiding this comment.
Yeah, good point, this could be better off as a plugin.
There was a problem hiding this comment.
thanks for the quick feedback / thoughts
@mohammed90 I can take a look at how the reverse proxy handler implements its custom transport and try to emulate here.
@mholt can you expand on what you mean by making this a plugin? (I see a few ways of achieving more custom, active health check so want to make sure i'm understanding)
There was a problem hiding this comment.
An http.RoundTripper can't really be directly configured from JSON. So you define a module field instead, e.g.:
caddy/modules/caddyhttp/reverseproxy/reverseproxy.go
Lines 75 to 78 in 99073ea
Then in Provision(), the module is initialized and converted into an http.RoundTripper:
caddy/modules/caddyhttp/reverseproxy/reverseproxy.go
Lines 239 to 259 in 99073ea
And the resulting http.RoundTripper is stored here, for example:
There was a problem hiding this comment.
yes this makes sense. I updated the PR to emulate , but removed the requestBuffer / fastcgi bit as I don't think it's relevant.
There was a problem hiding this comment.
thanks for the detailed reply. (when you said 'plugin' I was thinking of an entirely separate way to configure and run a custom active health checker, but that is a separate conversation probably)
|
Closing as inactive |
httpwhile the actual upstream useshttps.Related Discussion
Related Issues