velxio/backend/app/services/picow_net
David Montero bb4d06cc7a fix(picow): make the IoT gateway robust to real browsers
Two real-world failures hit the Pico W gateway that the headless e2e
(node fetch, tiny request, fast timing) didn't surface:

- A browser sends KILOBYTES of headers (cookies, User-Agent, sec-*).
  Forwarded verbatim, the request overran the chip's small recv()
  (e.g. recv(1024)); lwIP then RST the connection on close-with-unread-
  data, crashing blocking-socket sketches with ECONNRESET. Now we forward
  a MINIMAL request (method, path, Host, Connection: close, and
  Content-Type/Length for bodies) — nothing a tiny server can choke on.

- After a gateway request completed we dropped the connection immediately,
  so a late chip segment (retransmitted FIN / trailing ACK) no longer
  matched and fell through to the chip-initiated NAT, which RST it. Add a
  short TIME_WAIT: keep the connection briefly and re-ACK late segments so
  the chip closes cleanly, never RSTing it.
2026-06-14 03:11:54 +02:00
..
__init__.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
arp.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
bridge.py feat(picow): IoT gateway — proxy browser HTTP into the chip's server 2026-06-14 02:15:53 +02:00
checksums.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
consts.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
dhcp.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
dns.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
icmp.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
protocols.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
tcp_inbound.py fix(picow): make the IoT gateway robust to real browsers 2026-06-14 03:11:54 +02:00
tcp_nat.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00
udp_nat.py Implement TCP and UDP NAT services for chip-initiated connections 2026-04-29 08:43:41 -03:00