TCP relay / DNAT port forwarding (PROTOCORE_ENABLE_RELAY) - a bidirectional byte pump. More...
#include "protocore_config.h"Go to the source code of this file.
TCP relay / DNAT port forwarding (PROTOCORE_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 protocore_client on the device. The app drives it: each poll tick (or whenever a socket is readable/writable) it calls protocore_relay_step() until the relay reports DONE, then closes both sockets.
Correctness details:
Definition in file relay.h.