mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
fix(companion): pin the runner listener to loopback
This commit is contained in:
1 parent
b14d542310
commit
fb6cfce37c
1 file changed
+5
-1
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user