Hello,
The NSUrlSessionHandler is an HTTP client handler that delegates its work to Apple’s built-in NSUrlSession.
Referring to the underlying NSUrlSessionHandler wrapper at NSUrlSessionHandler.cs, you could find the following code snippet:
// We dont support any custom proxies, and don't let anybody wonder why their proxy isn't
// being used if they try to assign one (in any case we also return false from 'SupportsProxy').
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")]
public IWebProxy? Proxy {
get => null;
set => throw new PlatformNotSupportedException ();
}
Therefore, we could know that HttpClientHandler
doesn't support custom proxies in MacCatalyst.
There is a pull request in progress to implement this for .Net 7. You could follow this issue: .NET Implement NSUrlSessionHandler members that throw PlatformNotSupportedException #14632.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.