From 42fc819efc2cd97c0bd5628189a1ed71e410ce3c Mon Sep 17 00:00:00 2001 From: maziggy Date: Sat, 7 Feb 2026 15:34:12 +0100 Subject: [PATCH] Add proxy mode for virtual printer (cross-LAN slicer support) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Bambu Studio on a remote network to print through BamBuddy acting as a TLS-terminating proxy for both MQTT and FTP connections. - Add TLSProxy base class and FTPTLSProxy with PASV response rewriting, EPSV→PASV translation, PROT P/C tracking, and one-shot data proxies - Add SlicerProxyManager to coordinate per-slicer MQTT + FTP proxy pairs - Support additional SAN IPs in certificate generation for proxy mode - Broadcast SSDP on LAN B so slicers discover the proxy as a printer - Narrow FTP passive port range to 50000-50100 with retry logic - Expose proxy ports (8883, 9990, 50000-50100) in Dockerfile - Document passive port range in docker-compose.yml --- backend/app/services/virtual_printer/tcp_proxy.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/backend/app/services/virtual_printer/tcp_proxy.py b/backend/app/services/virtual_printer/tcp_proxy.py index 39594fa71..f7be92619 100644 --- a/backend/app/services/virtual_printer/tcp_proxy.py +++ b/backend/app/services/virtual_printer/tcp_proxy.py @@ -515,12 +515,6 @@ class FTPTLSProxy(TLSProxy): cmd_upper = line.strip().upper() - # Log all FTP commands from slicer - try: - logger.info("FTP cmd >>> %s", line.decode("utf-8", errors="replace")) - except Exception: - pass - # Replace EPSV with PASV so response includes an IP if cmd_upper == b"EPSV": line = b"PASV" @@ -593,12 +587,6 @@ class FTPTLSProxy(TLSProxy): line = buffer[:idx] buffer = buffer[idx + 2 :] - # Log all FTP responses from printer - try: - logger.info("FTP resp <<< %s", line.decode("utf-8", errors="replace")) - except Exception: - pass - rewritten = await self._maybe_rewrite_pasv(line, local_ip, session_state) output += rewritten + b"\r\n"