[Fix] Virtual Printer proxy mode fails on isolated networks (#757)

When the slicer and printer are on different VLANs, Bambu Studio could
  not send prints through the proxy because the printer's real IP leaked
  through MQTT payloads, the bind protocol forwarded the real printer's
  identity, file transfer and camera ports were not proxied, and FTP
  data connections raced the TLS handshake on zero-byte uploads.

  - Rewrite IP addresses in MQTT PUBLISH payloads (string + integer)
    with proper packet framing and cross-chunk buffering
  - Respond to bind/detect with VP identity via BindServer
  - Add TLS proxies for port 6000 (file transfer) and 322 (RTSP camera)
  - Buffer slicer FTP data during printer connection setup
  - Advertise configured VP name in SSDP proxy
  - Add cross-subnet SSDP wildcard listener for VPN setups
  - Register UserEmailPreference model in models/__init__.py
  - Add 11 unit tests for MQTT rewrite, IP conversion, SSDP name
This commit is contained in:
maziggy
2026-03-19 11:10:22 +01:00
parent 0b2b81a34d
commit 1b1f58fc88
3 changed files with 28 additions and 2 deletions
@@ -1089,6 +1089,8 @@ class TestSlicerProxyManager:
assert proxy_manager.LOCAL_MQTT_PORT == 8883
assert proxy_manager.PRINTER_FTP_PORT == 990
assert proxy_manager.PRINTER_MQTT_PORT == 8883
assert proxy_manager.PRINTER_FILE_TRANSFER_PORT == 6000
assert proxy_manager.PRINTER_RTSP_PORT == 322
# Bind ports: both 3000 and 3002 for slicer compatibility
assert proxy_manager.PRINTER_BIND_PORTS == [3000, 3002]