|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
TCP relay / DNAT port forwarding (DETWS_ENABLE_RELAY) - a bidirectional byte pump. More...
#include "ServerConfig.h"Go to the source code of this file.
TCP relay / DNAT port forwarding (DETWS_ENABLE_RELAY) - a bidirectional byte pump.
Publishes an internal host:port through the server: an inbound (accepted) connection is relayed to an origin (an outbound connection to the internal service), moving bytes in both directions. The engine is pure - it touches the two sockets only through send/recv seams - so it is host-testable and rides det_client on the device. The app drives it: each poll tick (or whenever a socket is readable/writable) it calls det_relay_step() until the relay reports DONE, then closes both sockets.
Correctness details:
send seam may accept fewer bytes than offered; the un-accepted bytes are carried in a per-direction buffer and retried on the next step before more are read.shutdown seam is called once (propagating the half-close so the origin sees the client's FIN); the relay is DONE only when both directions have finished.Definition in file relay.h.