Add proxy support for WKWebView - #84
Draft
KodamaSakuno wants to merge 1 commit into
Draft
KodamaSakuno wants to merge 1 commit into
KodamaSakuno wants to merge 1 commit into
Conversation
maxkatz6
reviewed
Sep 20, 2026
Comment on lines
+45
to
+59
| /// <summary> | ||
| /// Gets or sets the proxy address. | ||
| /// </summary> | ||
| public Uri? ProxyAddress { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the credentials used to authenticate with the proxy. | ||
| /// If set, this takes precedence over credentials embedded in <see cref="ProxyAddress"/>. | ||
| /// </summary> | ||
| public NetworkCredential? ProxyCredentials { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the list of domains to exclude from the proxy. | ||
| /// </summary> | ||
| public string[]? ProxyExcludedDomains { get; set; } |
Member
There was a problem hiding this comment.
I know it's not typically recommended to reuse types across domains, just because they fit similarly.
But what do you think of using .NET's WebProxy type here?
WebProxy has Address, BypassList and Credentials (proxy.Credentials.GetCredentials("Basic")) that cover these three config properties.
Contributor
Author
There was a problem hiding this comment.
Sounds good to me, WebProxy is suitable here. I need to test its behavior.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
WebView2 supports proxy configuration via
AdditionalBrowserArguments(e.g.--proxy-server=host:port). WKWebView should have an equivalent feature since macOS 14 / iOS 17 have supported it.Summary
Expose proxy configuration via
AppleWKWebViewEnvironmentRequestedEventArgs:ProxyAddress(Uri) — supportshttp,httpsandsocks5schemesProxyCredentials(NetworkCredential) — takes precedence over credentialsembedded in the proxy URI
ProxyExcludedDomains(string[]) — domains bypassing the proxyNotes