[GH-ISSUE #1368] WebSockets not being captured from Mac Safari #1363

Open
opened 2026-03-03 19:50:49 +03:00 by kerem · 7 comments
Owner

Originally created by @leearmstrong on GitHub (Sep 21, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1368

Description

I have a website that loads a wss:// connection. This does not show up in Proxyman but the web page loads fine, alongside the underlying WebSockets connection. I have explicitly added the wss:// domain to the SSL Proxying list but see nothing in Proxyman

Environment

  • App version: Proxyman 3.10.0
  • macOS version: macOS 12.6 Safari 16 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15)
Originally created by @leearmstrong on GitHub (Sep 21, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1368 ## Description I have a website that loads a wss:// connection. This does not show up in Proxyman but the web page loads fine, alongside the underlying WebSockets connection. I have explicitly added the wss:// domain to the SSL Proxying list but see nothing in Proxyman ## Environment - App version: Proxyman 3.10.0 - macOS version: macOS 12.6 Safari 16 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15)
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 21, 2022):

By default, the WSS traffic doesn't appear until we add SSL Proxying on the domain. If you don't mind, please find a domain that you think it's a WSS, then enable SSL Proxying on it.

For example:

  1. My WSS domain is wss://my_domain.com
  2. Search my_domain and Enable SSL Proxying
  3. Reload to make a WSS call again
  4. wss://my_domain.com will show
<!-- gh-comment-id:1253326151 --> @NghiaTranUIT commented on GitHub (Sep 21, 2022): By default, the WSS traffic doesn't appear until we add SSL Proxying on the domain. If you don't mind, please find a domain that you think it's a WSS, then enable SSL Proxying on it. For example: 1. My WSS domain is `wss://my_domain.com` 2. Search `my_domain` and Enable SSL Proxying 3. Reload to make a WSS call again 4. wss://my_domain.com will show
Author
Owner

@leearmstrong commented on GitHub (Sep 22, 2022):

Hello,

I already had my_domain as a wildcard and it wasn't working. I explicitly added the SubDomain to the list and it still does not work sadly.

I have just tried Chrome and it works ok there but not Safari

<!-- gh-comment-id:1254507903 --> @leearmstrong commented on GitHub (Sep 22, 2022): Hello, I already had `my_domain` as a wildcard and it wasn't working. I explicitly added the SubDomain to the list and it still does not work sadly. I have just tried Chrome and it works ok there but not Safari
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 22, 2022):

My educated guess is that WS/WSS traffic, which is called from Safari, doesn't go through the HTTP Proxy by default. It just works fine with Google Chrome / Firefox.

Not sure how to force Safari to use HTTP Proxy for the WebSocket traffic.

<!-- gh-comment-id:1254678453 --> @NghiaTranUIT commented on GitHub (Sep 22, 2022): My educated guess is that WS/WSS traffic, which is called from Safari, doesn't go through the HTTP Proxy by default. It just works fine with Google Chrome / Firefox. Not sure how to force Safari to use HTTP Proxy for the WebSocket traffic.
Author
Owner

@dizel3d commented on GitHub (Nov 23, 2022):

If you disable NSURLSession Websocket experimental feature, it will work.
image

<!-- gh-comment-id:1324779913 --> @dizel3d commented on GitHub (Nov 23, 2022): If you disable **NSURLSession Websocket** experimental feature, it will work. <img width="662" alt="image" src="https://user-images.githubusercontent.com/593571/203514678-1025e092-9415-4550-8876-0c1cc2a38f08.png">
Author
Owner

@ben-bourdin451 commented on GitHub (Jul 3, 2023):

If you disable NSURLSession Websocket experimental feature, it will work.

Although this does bypass the issue it's not really a solution since this setting is enabled by default in the latest versions of Safari and disabling the setting actually modifies the behaviour of Safair & WS connection. Point being that OP is probably (as am I) trying to debug an issue with this setting enabled.

@NghiaTranUIT you mention here that we can debug WS traffic 'out of the box' on Safari however it seems that no longer holds true. Can you verify that you are able to replicate this issue? Easiest way I found to verify this is to navigate to a known website that uses WS (e.g. slack) with the NSURLSession Websocket enabled.

If you have any other suggestions on how to inspect WS traffic in Safari, perhaps asides from using a source build, please share 🙏

<!-- gh-comment-id:1618449961 --> @ben-bourdin451 commented on GitHub (Jul 3, 2023): > If you disable **NSURLSession Websocket** experimental feature, it will work. Although this does bypass the issue it's not really a solution since this setting is enabled by default in the latest versions of Safari and disabling the setting actually modifies the behaviour of Safair & WS connection. Point being that OP is probably (as am I) trying to debug an issue with this setting enabled. @NghiaTranUIT you mention [here](https://github.com/ProxymanApp/Proxyman/issues/586#issuecomment-999223252) that we can debug WS traffic 'out of the box' on Safari however it seems that no longer holds true. Can you verify that you are able to replicate this issue? Easiest way I found to verify this is to navigate to a known website that uses WS (e.g. slack) with the `NSURLSession Websocket` enabled. If you have any other suggestions on how to inspect WS traffic in Safari, perhaps asides from using a source build, please share 🙏
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 3, 2023):

Can you verify that you are able to replicate this issue?

@ben-bourdin451 It's a known issue for all NSURLSessionWebsocket on iOS, macOS, and Web Safari too. NSURLSessionWebSocket doesn't go through the HTTP Proxy.

As I mention, Proxyman can work if it's a WS from Chrome or Firefox, but not Safari.

Can you open a ticket on Apple Support to ask them how to debug WS on Safari? I'd like to follow their suggestion to make it happen on Proxyman. For now, I don't have solution.

<!-- gh-comment-id:1618539686 --> @NghiaTranUIT commented on GitHub (Jul 3, 2023): > Can you verify that you are able to replicate this issue? @ben-bourdin451 It's a known issue for all NSURLSessionWebsocket on iOS, macOS, and Web Safari too. `NSURLSessionWebSocket` doesn't go through the HTTP Proxy. As I mention, Proxyman can work if it's a WS from Chrome or Firefox, but not Safari. Can you open a ticket on Apple Support to ask them how to debug WS on Safari? I'd like to follow their suggestion to make it happen on Proxyman. For now, I don't have solution.
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 3, 2023):

@ben-bourdin451 I guess there is a solution but I haven't tried it yet. By using Proxifier (https://www.proxifier.com/), it will force all traffic to go through an HTTP Proxy. I guess Websocket from Safari will work too.

<!-- gh-comment-id:1618545234 --> @NghiaTranUIT commented on GitHub (Jul 3, 2023): @ben-bourdin451 I guess there is a solution but I haven't tried it yet. By using Proxifier (https://www.proxifier.com/), it will force all traffic to go through an HTTP Proxy. I guess Websocket from Safari will work too.
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#1363
No description provided.