Skip to content

Proxy support for ESP8266HTTPClient #8085

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

Open
ChrisSmith opened this issue May 30, 2021 · 3 comments · May be fixed by #8094
Open

Proxy support for ESP8266HTTPClient #8085

ChrisSmith opened this issue May 30, 2021 · 3 comments · May be fixed by #8094
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.

Comments

@ChrisSmith
Copy link

Problem Description

I would be nice if the http client supported http proxies. Adding proxy support is relatively straightforward as its done using headers.

Regular HTTP request (connection to target 1.1.1.1)

GET / HTTP/1.1
Host: 1.1.1.1:8080
User-Agent: curl/7.68.0

Request to a proxy (connection to proxy 2.2.2.2)

GET http://1.1.1.1:8000/ HTTP/1.1
Host: 1.1.1.1:8000
User-Agent: curl/7.68.0

The primary difference is that the tcp connection doesn't match the host header and the full uri is used in the request line. Authorization could be manually performed using the current addHeader() method to add the Proxy-Authorization header.

I have working changes locally that I'd be happy to contribute if the maintainers think this is a worthwhile feature.

@d-a-v
Copy link
Collaborator

d-a-v commented May 30, 2021

Your Pull-Request is welcome !

@d-a-v d-a-v added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jun 1, 2021
@ChrisSmith ChrisSmith linked a pull request Jun 2, 2021 that will close this issue
@FAAAAT
Copy link

FAAAAT commented Jun 3, 2021

Hello ChrisSmith,

I have a proxy request similar as yours, but it's for https requests through http proxy. Is your PR support https request?

Thanks.

@ChrisSmith
Copy link
Author

ChrisSmith commented Jun 3, 2021

@FAAAAT are you referring to #8086? My implementation doesn't support the TCP tunneling required for CONNECT

I don't think thats required for a https proxy though, an alternative implementation would perform tls termination at the proxy which would be possible to support in my implementation but I have not tried it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants