fix(companion): pin the runner listener to loopback

This commit is contained in:
pj committed 2026-06-07 21:35:08 +05:30
1 parent b14d542310
commit fb6cfce37c
1 file changed
+5 -1
+5 -1
View File
@@ -24,7 +24,11 @@ final class Server {
self.port = NWEndpoint.Port(rawValue: resolvedPort)!
let parameters = NWParameters.tcp
parameters.allowLocalEndpointReuse = true
self.listener = try NWListener(using: parameters, on: self.port)
// The simulator shares the host network stack, so an unbound listener
// would be reachable from the host's LAN interfaces. Pin it to
// loopback so only local processes can drive the automation surface.
parameters.requiredLocalEndpoint = NWEndpoint.hostPort(host: "127.0.0.1", port: self.port)
self.listener = try NWListener(using: parameters)
}
func start() {