Hi Dev Forums and Quinn "The Eskimo!",
Short version Is there sample NWConnection code available that behaves in a similar way to the higher level URLSession and URLRequest APIs?
Long version I have not been able to make this question get past the "sensitive language filter" on the dev forums. I figured it might be 'fool' or 'heck', or the X link, but removing each of those still triggers the sensitive language filter.
Please see this gist: https://gist.github.com/lzell/8672c26ecb6ee1bb26d3aa3c7d67dd62
Thank you!
Lou Zell
Before I follow too far down this rabbit hole, I want to run an alternative past you. Have you tried setting a custom resolver on the default privacy context? So, something like this:
let myResolver = URL(string: "https://dns.example.com")!
let myResolverAddresses: [NWEndpoint] = [.hostPort(host: "1.2.3.4", port: 443)]
let c = NWParameters.PrivacyContext.default
c.requireEncryptedNameResolution(true, fallbackResolver: .https(myResolver, serverAddresses: myResolverAddresses))
ps The problem with your main post was the URL in your first footnote. It contains a long string of decimal digits, and every now and again such strings evoke the ire of the DevForums content filter. This is a known issue in that filter (r. 123229234).
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"