-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Feature/http response configurable proxy #3374 #3626
Feature/http response configurable proxy #3374 #3626
Conversation
…tp to https. the proxy receives a GET for http://domain.de:443domain:443 if follow_redirects=true
Looks good but I wonder if we need support for @cpoule23 can you provide a bit more information about your setup and how you will use this? |
Hello Danielnelson, I'm using http_response inside a company with proxy usage for security/flexibility reasons. I need to test some internal URL so I have to reach them without proxy and internet URL so with proxy. Without "NO_PROXY" settings, all my requests (internal too) will try to reach firstly the proxy and he will not find the URL as he will try to go on internet too find them. NO_PROXY for my internal domain (intranet, home made application), proxy for all others on public URL. I hope it's clear for the need ? |
@cpoule23 so you want to be able to override the system wide proxy by "no proxy" for internal domains, right? I think that's indeed a use-case for no_proxy. |
yes :) Or maybe it's not a good way to proceed |
@cpoule23 You can add these environment variables to |
@cpoule23 Just to be clear, do you need a per plugin |
Hello, If you add http & https_proxy settings inside http_response and if internal will use the /etc/default/telegraf for no_proxy setting it's fine for me :) |
You won't be able to mix the settings location with this patch. For instance, you won't be able to use the It sounds like perhaps you don't need this patch, but instead have an issue with the environment variables not working as expected. Can you let me know what your env vars are set to and one of the urls you are having trouble with, describe what you expect to happen and what telegraf actually does. |
Hello,
|
I think you shouldn't have the single quotes in no_proxy, though I'm not sure that this would make it so the proxy is not working for proxy sites:
Can you run these commands from bash:
|
@@ -49,6 +50,9 @@ var sampleConfig = ` | |||
## Server address (default http://localhost) | |||
# address = "http://localhost" | |||
|
|||
## Set proxy (telegraf uses the system wide proxy settings if proxy is not set) | |||
# proxy = "http://localhost:8888" |
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.
Let's change this to http_proxy to match the variable name in other plugins.
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.
Ok, sounds legit. Did that and will push it right after I tested it.
Hello Danielnelson, -/etc/default/telegraf
-telegraf.conf
-http_proxy=http://myproxyURL:3128 curl http://www.lemonde.fr -v -o /dev/null
-http_proxy=http://myproxy:3128 telegraf --input-filter http_response --test
I have a timeout to reach http://www.lemonde.fr :/ Do you have an idea please ? |
Pushed the change to http_proxy to be consistent with existing plugins supporting this setting. |
@danielnelson I tested and pushed the latest code. How to proceed regarding the CircleCI failures? As far as I see it, we don't have much influence on the failures because they're caused by other modules, etc. Is there anything else from my / our side required before this pull request can be accepted? |
The last failure in particular can be fixed by rebasing against master, but sometimes we have intermittent failure due to unfixed bugs in tests, in the future don't worry about these too much as I can rerun the builds manually if I see them. |
What if the http proxy has username and password? Is there a way we can add those as part of the config. |
@hkadakia Try setting the username and password in the userinfo section of the URL:
You may need to escape special characters in the password, if you need more help please ask on the InfluxData Community site. |
@hkadakia, I'm sorry for the late reply. I missed the notification. The way described by @danielnelson was tested and should work. |
Required for all PRs:
These 2 commits fix #3374