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

Add support for http proxy to esp8266 http client #8094

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ChrisSmith
Copy link

Fixes #8085

I was able to verify this works with my proxy setup, it would be good for others to test as well, I'm no expert on how proxies are configured.

I do very little c++ so don't be afraid to give me lots of feedback :)

@@ -177,6 +177,7 @@ class HTTPClient
void setAuthorization(const char * user, const char * password);
void setAuthorization(const char * auth);
void setTimeout(uint16_t timeout);
bool setProxyHost(const String &proxyUrl);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample usage

WiFiClient client;
HTTPClient http;

http.setProxyHost("http://192.168.1.1:8080");
http.begin(client, "http://foo.bar/");
  
// If the proxy requires auth
http.addHeader("Proxy-Authorization", "Basic aaaaaaaaaaaa=");
http.GET();

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about putting a line in the documentation, or adding an example ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, can you point me to where those are located?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the HTTPClient examples location.
As you can see, the file hierarchy is myExampleName/myExampleName.ino.

Documentation is ...
... there's absolutely no official documentation on HTTPClient.
So your addition will be added in the documentation when it will be written for the whole class, or if we add doxygen at some point.

@d-a-v d-a-v added the alpha included in alpha release label Jun 2, 2021
Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your time on this factorisation effort !
Little changes, the most important are the debug lines that were mistakingly added I believe

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h Outdated Show resolved Hide resolved
libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h Outdated Show resolved Hide resolved
libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp Outdated Show resolved Hide resolved
libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp Outdated Show resolved Hide resolved
@d-a-v
Copy link
Collaborator

d-a-v commented Jun 4, 2021

Thanks for all your updates !
CI is still complaining:
https://github.com/esp8266/Arduino/pull/8094/checks?check_run_id=2744634954#step:5:117

Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience !

@d-a-v d-a-v added this to the 3.1 milestone Jul 11, 2021
@d-a-v
Copy link
Collaborator

d-a-v commented Sep 29, 2021

@ChrisSmith Do you think you can solve the conflict, or do you need help ?
I/someone will merge right after the fix

@d-a-v d-a-v added the merge-conflict PR has a merge conflict that needs manual correction label Sep 29, 2021
@ChrisSmith
Copy link
Author

Hey @d-a-v I don't have time to resolve the conflict and test at the moment. You should be able to resolve + commit to this branch if you'd like. Otherwise I'll get to it when I am free

@mcspr
Copy link
Collaborator

mcspr commented Oct 13, 2021

#8237 also broke this even more, so I don't mind fixing this instead of @d-a-v

@mcspr mcspr modified the milestones: 3.1, 4.0.0 Dec 20, 2022
@d-a-v d-a-v removed the alpha included in alpha release label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict PR has a merge conflict that needs manual correction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proxy support for ESP8266HTTPClient
3 participants