Post

Replies

Boosts

Views

Activity

Reply to OHTTP with WKWebView not working as expected
I attempted this with the beta 3 releases earlier today, but unfortunately still encounter the same issue with the OHTTP proxy as the original poster. I've added code like this to my app: let configuration = WKWebViewConfiguration() if #available(iOS 17.0, *) { let endpoint = NWEndpoint.url(URL(string: "<relay server URL goes here>")!) let hop = ProxyConfiguration.RelayHop(http2RelayEndpoint: endpoint) let proxyConfiguration = ProxyConfiguration(obliviousHTTPRelay: hop, relayResourcePath: "/gateway", gatewayKeyConfig: keyData, // Fetched earlier from the gateway's /ohttp-keys endpoint matchDomains: ["example.com"]) configuration.websiteDataStore.proxyConfigurations = [proxyConfiguration] } // ...set configuration on WKWebView, etc... However, no matter what values I set for matchDomains (including an empty array), the relay server is never hit and the app behaves as if no proxy is set. I'm able to ping the relay server with curl and see requests come in, so that shouldn't be the issue. I'm able to successfully use other proxy types - I've tried a SOCKS proxy, and it works great. I considered the possibility that my configuration values are wrong, but if that were true I would expect the navigation requests from the web view to fail (which they do when you provide a SOCKS proxy with a bad URL, for instance). Let me know if I've overlooked something, and thanks for such a nice addition to the WebKit API! :heart:
Jul ’23
Reply to OHTTP with WKWebView not working as expected
I attempted this with the beta 3 releases earlier today, but unfortunately still encounter the same issue with the OHTTP proxy as the original poster. I've added code like this to my app: let configuration = WKWebViewConfiguration() if #available(iOS 17.0, *) { let endpoint = NWEndpoint.url(URL(string: "<relay server URL goes here>")!) let hop = ProxyConfiguration.RelayHop(http2RelayEndpoint: endpoint) let proxyConfiguration = ProxyConfiguration(obliviousHTTPRelay: hop, relayResourcePath: "/gateway", gatewayKeyConfig: keyData, // Fetched earlier from the gateway's /ohttp-keys endpoint matchDomains: ["example.com"]) configuration.websiteDataStore.proxyConfigurations = [proxyConfiguration] } // ...set configuration on WKWebView, etc... However, no matter what values I set for matchDomains (including an empty array), the relay server is never hit and the app behaves as if no proxy is set. I'm able to ping the relay server with curl and see requests come in, so that shouldn't be the issue. I'm able to successfully use other proxy types - I've tried a SOCKS proxy, and it works great. I considered the possibility that my configuration values are wrong, but if that were true I would expect the navigation requests from the web view to fail (which they do when you provide a SOCKS proxy with a bad URL, for instance). Let me know if I've overlooked something, and thanks for such a nice addition to the WebKit API! :heart:
Replies
Boosts
Views
Activity
Jul ’23