-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
ESP8266 HTTPClient cannot be reused to connect to a second, different host #8331
Comments
Same error here, thanks for the workaround. I tried with two HTTPClients but it didn't worked better, it worked one time but no more luck...
|
Does it work if you use
Although I'm not sure if begin could be called twice to the same URL with the expectation of connection reuse. I think it's unlikely. |
I tested it with Here is the function I use to to send a message to two esp8266 slaves from a master :
I previously used this method and it worked all the time:
|
Thank you ! |
Basic Infos
Platform
Settings in IDE
Problem Description
In my program, I am trying to reuse an
HTTPClient
to make a second connection to a different server. If the first server sendsConnection: keep-alive
, theHTTPClient
attempts to reuse the connection when connecting to the new server, even though it's connecting to a new host.It seems to me like
begin
orbeginInternal
should check if the new connection will be to the same host/port, and clear_canReuse
otherwise.setURL
does something like that, but it is only called when handling redirects.You can work around this by calling
setReuse(false)
, but I don't think that should be necessary to handle this use case.The code below demonstrates this:
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: