iosgrpcbonjourswift-niogrpc-swift

Can I connect to a Swift gRPC server over a local network via Bonjour (zeroconf)?


I am working on an iOS app where one device will act as the server and other devices on the same local network will connect to the server device. I would like to use Bonjour for the clients to discover the server so that users don't need to mess around with IP addresses. I am able to use Bonjour to publish the server to the network and I am able to connect to it and send data using Apple's Network framework. I would like to use gRPC to send messages between the server and client devices. Is there a way to tell gRPC to connect to a server from an NWEndpoint? I was able to find a way for SwiftNIO to bind to an NWEndpoint, and since Swift gRPC is built on top of SwiftNIO, it would make sense that there might also be a way for gRPC to bind to an NWEndpoint, but I have not been able to figure it out.


Solution

  • This is a missing feature, I think. Please file a bug report on the gRPC-swift repo, it should be fairly easy to add.