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?)

@caseyliss my reading of https://datatracker.ietf.org/doc/html/rfc6874 is that you must percent-escape the %:

http://[<IPv6address>%25<zoneID>]

RFC 6874: Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers

This document describes how the zone identifier of an IPv6 scoped address, defined as <zone_id> in the IPv6 Scoped Address Architecture (RFC 4007), can be represented in a literal IPv6 address and in a Uniform Resource Identifier that includes such a literal address. It updates the URI Generic Syntax specification (RFC 3986) accordingly.

IETF Datatracker
@_nd_ nailed it. Thank you!!!