From 496a94461f3764b1011fefbc360c87bdf056b8ed Mon Sep 17 00:00:00 2001 From: Finalthief <148212151+Finalthief@users.noreply.github.com> Date: Tue, 13 Oct 2026 20:40:22 -0400 Subject: [PATCH] fix: bind the MJPEG server to the USE_IP address USE_IP (FBConfiguration.bindingIPAddress) restricts the HTTP server to one address via setInterface:, but the MJPEG screenshots broadcaster never set FBTCPSocket.interface, so it always listened on every interface. Apply the same binding address to the broadcaster. When USE_IP is not set the interface stays nil and behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 --- WebDriverAgentLib/Routing/FBWebServer.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WebDriverAgentLib/Routing/FBWebServer.m b/WebDriverAgentLib/Routing/FBWebServer.m index af0d82b3e..22f872ceb 100644 --- a/WebDriverAgentLib/Routing/FBWebServer.m +++ b/WebDriverAgentLib/Routing/FBWebServer.m @@ -133,6 +133,9 @@ - (void)initScreenshotsBroadcaster self.mjpegServer = [[FBMjpegServer alloc] init]; self.screenshotsBroadcaster = [[FBTCPSocket alloc] initWithPort:(uint16_t)FBConfiguration.sharedInstance.mjpegServerPort]; + // Bind to the same address as the HTTP server when USE_IP is set. + // nil (the default) keeps listening on all interfaces. + self.screenshotsBroadcaster.interface = FBConfiguration.sharedInstance.bindingIPAddress; self.mjpegServer.socket = self.screenshotsBroadcaster; self.screenshotsBroadcaster.delegate = self.mjpegServer; NSError *error;