[GH-ISSUE #1333] Requests from WKWebview invisible? #1327

Open
opened 2026-03-03 19:50:31 +03:00 by kerem · 15 comments
Owner

Originally created by @fuggly on GitHub (Aug 17, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1333

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman 3.8.0
Mac Monterey 12.5

I apologise if this has been answered somewhere before, but I couldn't really find anything, so I will ask here:

I cannot see any requests from WKWebView. Funny enough, I can see all other requests that we make with our iOS app (outside WKWebview). But those that come from a WKWebView, including the first loading request, but also all other links that are clicked inside, are not visible in Proxyman. We use Atlantis as well and have it running not he debug builds, but regardless of Atlantis included, running or not, WKWebView requests are invisible.

Is there anything we can do to make them visible? Or something we can troubleshoot?

Originally created by @fuggly on GitHub (Aug 17, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1333 Originally assigned to: @NghiaTranUIT on GitHub. Proxyman 3.8.0 Mac Monterey 12.5 I apologise if this has been answered somewhere before, but I couldn't really find anything, so I will ask here: I cannot see any requests from WKWebView. Funny enough, I can see all other requests that we make with our iOS app (outside WKWebview). But those that come from a WKWebView, including the first loading request, but also all other links that are clicked inside, are not visible in Proxyman. We use Atlantis as well and have it running not he debug builds, but regardless of Atlantis included, running or not, WKWebView requests are invisible. Is there anything we can do to make them visible? Or something we can troubleshoot?
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2022):

By default, all traffic from WKWebView doesn't go through the HTTP Proxy from your iPhone, so Proxyman could not capture it.

Ref: https://developer.apple.com/forums/thread/110312


So, from what I experience, there is no way to capture traffic from WKWebview on iOS devices.

<!-- gh-comment-id:1217614229 --> @NghiaTranUIT commented on GitHub (Aug 17, 2022): By default, all traffic from WKWebView doesn't go through the HTTP Proxy from your iPhone, so Proxyman could not capture it. Ref: https://developer.apple.com/forums/thread/110312 ---------- So, from what I experience, there is no way to capture traffic from WKWebview on iOS devices.
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2022):

and here: https://stackoverflow.com/a/55541462/3127477

<!-- gh-comment-id:1217615168 --> @NghiaTranUIT commented on GitHub (Aug 17, 2022): and here: https://stackoverflow.com/a/55541462/3127477
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 17, 2022):

if you use Proxyman for iOS, I believe that the traffic from WKWebview can be captured because "Proxyman for iOS" uses the VPN, instead of a local proxy server.

<!-- gh-comment-id:1217617886 --> @NghiaTranUIT commented on GitHub (Aug 17, 2022): if you use Proxyman for iOS, I believe that the traffic from WKWebview can be captured because "Proxyman for iOS" uses the VPN, instead of a local proxy server.
Author
Owner

@fuggly commented on GitHub (Aug 17, 2022):

Oh cool thanks, using the VPN I can see the traffic on my device. Cool, thanks!

<!-- gh-comment-id:1217651716 --> @fuggly commented on GitHub (Aug 17, 2022): Oh cool thanks, using the VPN I can see the traffic on my device. Cool, thanks!
Author
Owner

@Carrione commented on GitHub (Oct 2, 2023):

Thanks, good to know.

<!-- gh-comment-id:1742859054 --> @Carrione commented on GitHub (Oct 2, 2023): Thanks, good to know.
Author
Owner

@Eddcapone commented on GitHub (Jan 9, 2024):

So I need to install proxyman on a MAC book?

<!-- gh-comment-id:1882938573 --> @Eddcapone commented on GitHub (Jan 9, 2024): So I need to install proxyman on a MAC book?
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 9, 2024):

@Eddcapone yes, it's. Websocket is a features from the Macbook/Windows version 👍

<!-- gh-comment-id:1882982111 --> @NghiaTranUIT commented on GitHub (Jan 9, 2024): @Eddcapone yes, it's. Websocket is a features from the Macbook/Windows version 👍
Author
Owner

@Eddcapone commented on GitHub (Jan 10, 2024):

@NghiaTranUIT Thx, I can confirm that it works on a MAC book. But your wrote Websocket is a feature from Macbook/Windows version, then why does it not work on windows?

<!-- gh-comment-id:1885085579 --> @Eddcapone commented on GitHub (Jan 10, 2024): @NghiaTranUIT Thx, I can confirm that it works on a MAC book. But your wrote Websocket is a feature from Macbook/Windows version, then why does it not work on windows?
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 11, 2024):

@Eddcapone it should work on Windows and Linux too.

  1. Can you describe your setup?
  2. Is it from iOS/Android or your Windows Web Browser app?
<!-- gh-comment-id:1886069183 --> @NghiaTranUIT commented on GitHub (Jan 11, 2024): @Eddcapone it should work on Windows and Linux too. 1. Can you describe your setup? 2. Is it from iOS/Android or your Windows Web Browser app?
Author
Owner

@Eddcapone commented on GitHub (Jan 16, 2024):

@NghiaTranUIT It works, but it does not catch all requests on windows. If I use the mac book, then it catches everything.

<!-- gh-comment-id:1893593848 --> @Eddcapone commented on GitHub (Jan 16, 2024): @NghiaTranUIT It works, but it does not catch all requests on windows. If I use the mac book, then it catches everything.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 17, 2024):

@Eddcapone then, it's not a bug from Proxyman. Some Windows apps don't respect the System HTTP Proxy. Their requests go directly to the Internet. So, Proxyman can't capture it.

You might find the Proxy Setting in your Windows app, to see if we can override it.

<!-- gh-comment-id:1895211953 --> @NghiaTranUIT commented on GitHub (Jan 17, 2024): @Eddcapone then, it's not a bug from Proxyman. Some Windows apps don't respect the System HTTP Proxy. Their requests go directly to the Internet. So, Proxyman can't capture it. You might find the Proxy Setting in your Windows app, to see if we can override it.
Author
Owner

@Eddcapone commented on GitHub (Jan 19, 2024):

@NghiaTranUIT It has nothing to do with windows itself, I just host proxyman on a windows machine. I connected from an iphone to proxyman and it did not capture most of the requests.

<!-- gh-comment-id:1900007979 --> @Eddcapone commented on GitHub (Jan 19, 2024): @NghiaTranUIT It has nothing to do with windows itself, I just host proxyman on a windows machine. I connected from an iphone to proxyman and it did not capture most of the requests.
Author
Owner

@esteluk commented on GitHub (Aug 28, 2024):

On the original point, it's now possible (iOS 17+) to show WKWebView traffic in Proxyman if you manually configure the webview's proxy configuration: https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations

<!-- gh-comment-id:2315364237 --> @esteluk commented on GitHub (Aug 28, 2024): On the original point, it's now possible (iOS 17+) to show WKWebView traffic in Proxyman if you manually configure the webview's proxy configuration: https://developer.apple.com/documentation/webkit/wkwebsitedatastore/4264546-proxyconfigurations
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 28, 2024):

@esteluk does it work with fetch/axios on WKWebView ?

<!-- gh-comment-id:2315377457 --> @NghiaTranUIT commented on GitHub (Aug 28, 2024): @esteluk does it work with fetch/axios on WKWebView ?
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 29, 2024):

Thanks @esteluk . Confirmed that Proxyman can capture traffic from WKWebView

Here is the sample code:

  1. Set HTTP Proxy to WKWebView
    lazy var webView: WKWebView = {
        let webConfiguration = WKWebViewConfiguration()

        // ✅ define Proxy Setting to Proxyman
        let httpProxy = ProxyConfiguration(
            httpCONNECTProxy: NWEndpoint.hostPort(
                host: NWEndpoint.Host(
                    "127.0.0.1"
                ),
                port: NWEndpoint.Port(
                    integerLiteral: 9090
                )
            )
        )

        // ✅ Tell WKWebView to use the Proxy
        let dataSource = WKWebsiteDataStore.default()
        dataSource.proxyConfigurations = [httpProxy]
        webConfiguration.websiteDataStore = dataSource
        
        // init view
        let webView = WKWebView(
            frame: .zero,
            configuration: webConfiguration
        )
        webView.translatesAutoresizingMaskIntoConstraints = false
        return webView
    }()
  1. Open Proxyman and install the certificate to iOS Simulator (Certificate menu -> Install for iOS -> Simulator). It works with iPhone/iPad physical device too.
  2. Done

Capture network traffic from WKWebView iOS 18

<!-- gh-comment-id:2316576247 --> @NghiaTranUIT commented on GitHub (Aug 29, 2024): Thanks @esteluk . Confirmed that Proxyman can capture traffic from WKWebView Here is the sample code: 1. Set HTTP Proxy to WKWebView ```swift lazy var webView: WKWebView = { let webConfiguration = WKWebViewConfiguration() // ✅ define Proxy Setting to Proxyman let httpProxy = ProxyConfiguration( httpCONNECTProxy: NWEndpoint.hostPort( host: NWEndpoint.Host( "127.0.0.1" ), port: NWEndpoint.Port( integerLiteral: 9090 ) ) ) // ✅ Tell WKWebView to use the Proxy let dataSource = WKWebsiteDataStore.default() dataSource.proxyConfigurations = [httpProxy] webConfiguration.websiteDataStore = dataSource // init view let webView = WKWebView( frame: .zero, configuration: webConfiguration ) webView.translatesAutoresizingMaskIntoConstraints = false return webView }() ``` 2. Open Proxyman and install the certificate to iOS Simulator (Certificate menu -> Install for iOS -> Simulator). It works with iPhone/iPad physical device too. 3. Done ✅ ![Capture network traffic from WKWebView iOS 18](https://github.com/user-attachments/assets/cbb3597f-170a-49c0-b804-2dd7067ef46d)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1327
No description provided.