I'm out of my depth.

I'm trying to make a URL GET request to a service I'm discovering via Bonjour.

I have gotten a NWBrowser.Result, and I've gotten an NWEndpoint.

The endpoint is an IPv6 link local address.

How the hell do I make a URLRequest to this? I don't seem to be able to construct a URL from what I've got, but I suspect I'm holding it wrong.

Again, this is probably simple, but I'm way out of my depth here.

Wait, it seems the presence of “%en0" at the end may be the problem?

I can construct the URL without that, but actually connecting to that server with URLSession doesn't work.

(Worth noting it's HTTP not HTTPS; could ATS be stomping on me? If so, how would I know?)

Whoops. I didn't think of that. @_nd_ pointed out I need to percent-escape… the percent sign. That got me over the finish line. 🎉

https://fnordon.de/@_nd_/110881126508440982

Andreas Hartl (@[email protected])

@[email protected] my reading of https://datatracker.ietf.org/doc/html/rfc6874 is that you must percent-escape the %: http://[<IPv6address>%25<zoneID>]

Fnordon
@caseyliss @_nd_ “escape the percent sign” sounds like something from a self help book