From edef9bf74c6dc7dc1944c3fc42d1ea8d702af0ef Mon Sep 17 00:00:00 2001 From: herval Date: Mon, 9 Dec 2024 16:58:40 -0500 Subject: [PATCH] allow remote xctest connections w/ a flag --- .../maestro-driver-iosUITests/Routes/XCTestHTTPServer.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTestHTTPServer.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTestHTTPServer.swift index 7b21c23158..af688d53b4 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTestHTTPServer.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTestHTTPServer.swift @@ -25,10 +25,11 @@ enum Route: String, CaseIterable { struct XCTestHTTPServer { func start() async throws { - let port = ProcessInfo.processInfo.environment["PORT"]?.toUInt16() + let port = ProcessInfo.processInfo.environment["PORT"]?.toUInt16() ?? 22087 + let acceptRemoteConnections = ProcessInfo.processInfo.environment["ACCEPT_REMOTE_CONNECTIONS"] == "true" - let address = acceptRemoteConnections ? .inet(port: port) : .loopback(port: port) + let server = HTTPServer(address: acceptRemoteConnections ? .inet6(port: port) : .loopback(port: port)) for route in Route.allCases { let handler = await RouteHandlerFactory.createRouteHandler(route: route)