setProxyOverride method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'ProxyController.setProxyOverride', apiUrl: 'https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable)'), IOSPlatform(apiName: 'WKWebsiteDataStore.proxyConfigurations', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations', available: '17.0'), MacOSPlatform(apiName: 'WKWebsiteDataStore.proxyConfigurations', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations', available: '14.0'), LinuxPlatform(apiName: 'webkit_network_session_set_proxy_settings', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.NetworkSession.set_proxy_settings.html')])
- required ProxySettings settings,
Sets ProxySettings which will be used by all WebViews in the app.
URLs that match patterns in the bypass list will not be directed to any proxy.
Instead, the request will be made directly to the origin specified by the URL.
Network connections are not guaranteed to immediately use the new proxy setting; wait for the method to return before loading a page.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - ProxyController.setProxyOverride)
- iOS WKWebView 17.0+ (Official API - WKWebsiteDataStore.proxyConfigurations)
- macOS WKWebView 14.0+ (Official API - WKWebsiteDataStore.proxyConfigurations)
- Linux WPE WebKit (Official API - webkit_network_session_set_proxy_settings)
Parameters - Officially Supported Platforms/Implementations:
settings: all platforms
Use the PlatformProxyController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'ProxyController.setProxyOverride',
apiUrl:
'https://developer.android.com/reference/androidx/webkit/ProxyController#setProxyOverride(androidx.webkit.ProxyConfig,%20java.util.concurrent.Executor,%20java.lang.Runnable)',
),
IOSPlatform(
apiName: 'WKWebsiteDataStore.proxyConfigurations',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations',
available: '17.0',
),
MacOSPlatform(
apiName: 'WKWebsiteDataStore.proxyConfigurations',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations',
available: '14.0',
),
LinuxPlatform(
apiName: 'webkit_network_session_set_proxy_settings',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.NetworkSession.set_proxy_settings.html',
),
],
)
Future<void> setProxyOverride({required ProxySettings settings}) {
throw UnimplementedError(
'setProxyOverride is not implemented on the current platform',
);
}