-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
upstream: net.http_proxy setting for all upstream plugins. #10174
base: master
Are you sure you want to change the base?
Conversation
Please let me know if I missed something here but the thing is that there is no HTTP proxy client implementation at the moment. AFAIK it used to be implemented directly in the http client and when I created the new one I didn't include for "reasons" I can't remember. In any case, if we are going to move it to the networking layer we'll probably need to make a few tweaks to the HTTP client to ensure that we can use it in a transient way and pass the socket around so we can establish the raw connection, use the existing HTTP client to negotiate the tunnel and then return the socket for the client code to use as if it was a freshly established connection. |
As for the "old" HTTP proxy approach I think we should implement that directly in the "client" part of the HTTP client component but we should have a conversation about it to ensure that we're not mixing things around so we don't have to rework it once it's done. |
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.
This is not a complete review, I just noticed this in the log and wanted to ensure that I don't forget to bring it up.
u->proxy_password = flb_strdup(proxy_password); | ||
} | ||
|
||
flb_free(proxy_protocol); |
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.
Are these always non NULL even if empty? otherwise they might need checks.
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.
All of those values get assigned in ``flb_utils_proxy_url_split` unless it returns -1.
@@ -1471,6 +1471,14 @@ int flb_output_log_check(struct flb_output_instance *ins, int l) | |||
int flb_output_upstream_set(struct flb_upstream *u, struct flb_output_instance *ins) |
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.
Same as in flb_input_upstream_set
with the additional question "why are we duplicating this code?"
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.
I arrived late to the party so I have no idea why there is a separate file and set of APIs for input upstream versus output upstream.
I'll take a look at it and if I get anywhere open another PR to reduce the duplicate code.
So the proxy implementation in the old API disappeared when the client API was re-written? |
Yes, to be specific I didn't implement it, IIRC I wanted to take the opportunity to improve the implementation rather than hacking together something sub optimal and it ended up not getting done. |
Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Whelan <[email protected]>
…nfig. Signed-off-by: Phillip Whelan <[email protected]>
…ent variables. Signed-off-by: Phillip Whelan <[email protected]>
…ables. Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
…ream_set. Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
…L in flb_input_upstream_set. Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
…uble free in flb_output_upstream_set. Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
…ble free in flb_input_upstream_set. Signed-off-by: Phillip Adair Stewart Whelan <[email protected]>
…ut when not using a proxy. Signed-off-by: Phillip Whelan <[email protected]>
…using a proxy. Signed-off-by: Phillip Whelan <[email protected]>
Signed-off-by: Phillip Whelan <[email protected]>
511c058
to
8de8c46
Compare
Summary
Add a new
net.http_proxy
as well as a newnet.no_proxy
setting that can be set both globally as well as individually for any input client or output plugin.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.