-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[IDF5.x] Client remoteIP incorrect #8774
Comments
Hi, seems this is caused by breaking changes in migration from 2.X to 3.X. We will soon finish migration guide and I will create one issue, where we will collect all the questions and possible issue to not overflow project issue tracker. |
OK, can you maybe already tell me which function I should use here so I can already test with it? |
#8716 here is the Migration Guide PR |
OK, so it wasn't an API change. I suspect it may have something to do with bool WiFiClient::operator==(const WiFiClient& rhs) Here is the client being set in the WebServer: void WebServer::handleClient() {
if (_currentStatus == HC_NONE) {
_currentClient = _server.available(); However.... WiFiClient WiFiServer::available(){
if(!_listening)
return WiFiClient(); This function also returns a default WiFiClient() when N.B. I do not (yet) use IPv6 and it seems like So it seems like either the N.B.2: _listening is only set to true when the |
By the way, this seems to be fixed, so I will close it now. |
Board
ESP32 (classic)
Device Description
WROOM ESP32
Hardware Configuration
Version
other
IDE Name
PlatformIO
Operating System
Windows 11
Flash frequency
40MHz
PSRAM enabled
yes
Upload speed
115200
Description
When calling
web_server.client().remoteIP()
I no longer get the IP-adres of the connected client.In my project (ESPEasy) I try to block connections not coming from the local subnet.
In some occasions the browser doesn't seem to provide the client IP, so there was an exception for 0.0.0.0 to be allowed.
This has been working fine for years and doesn't seem to be a problem on ESP32-S2/C3
But on the ESP32 classic, I'm now experiencing blocks even with random looking reported remote IP-addresses like
35.0.6.0
. (I'm on the same subnet as my ESP node)On ESP32-S3/C3 running
ESP32 SDK 5.1.1.230920
I noticed I never see the client IP (remoteIP()
) anymore.On recent builds using the same code build with
ESP32 SDK 4.4.5.230614
I can get the client IP just fine.I use @Jason2866 's packaged platform packages:
platform = https://github.com/Jason2866/platform-espressif32.git#ae949bcf416213717662095f67cd76d85a810529
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: