Search code examples
iosswift-nio

How do I make the app allow incoming network connections with SwiftNIO?


I am using MicroExpress to create a web server in a SwiftUI app. I can connect to the server when I am running the app in Simulator, but I cannot make it work on my real device.

MicroExpress (based on SwiftNIO) creates a Webserver on the iPhone and shall expose an API in the local network.

I think I need to add a capability or something, but I cannot find the network capability nor a setting to allow incoming network connections in Xcode 11 under Signing & Capabilities.

How do I make the app allow incoming network connections?

EDIT

I have already added Allow Arbitrary Loads to allow HTTP if that is necessary. I am connecting over HTTP at the moment.


Solution

  • I looked at the tutorial and I think you need to bind to 0.0.0.0 instead of localhost. Doesn't have to do with capabilities nor ATS.