Skip to content

ESP8266WifiServer timeout when requesting through external IP #8853

@nbaztec

Description

@nbaztec

I have a basic ESP8266WebServer that sends roughly 1000 characters worth of response via send(). Everything works fine when the traffic is over the local IPv4 address 192.168.xx.xx.

However, I have set up port forwarding over my external IP to be directed to the NodeMCU device, and when the request is made over the external IP 87.xx.xx.xx via a device connected to the local network, the server times out during send() operation. Upon closer inspection, it seems that ClientContext::availableForWrite() / tcp_sndbuf returns 0 in this case. Increasing the timeout to 10s didn't help. Seems the buffer is never available.

As an additional step, I set up a VPN on the request device to make the request device's IP as 105.xx.xx.xx and made the same request. This time ClientContext::availableForWrite() / tcp_sndbuf returned a non-zero value and the request was successful.

Any ideas why the tcp_sndbuf would not work when a request is made by a device connected on the same network but via external IP that is port forwarded to my NodeMCU?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions