Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

Feature Request: WebSocket protocol support

Open zhuyingda opened this issue 4 years ago • 8 comments

Proxyman version? (Ex. Proxyman 1.4.3)

Version 2.35.0 (23500)

macOS Version? (Ex. mac 10.14)

11.6 (20G165)

Steps to reproduce

Using any programming language SDK to start a websocket server (ws or wss) at 127.0.0.1:8003 or other ip/port, and then start a client to connect this websocket server.

Expected behavior

See ws traffic in Proxyman GUI, just like Charles.

Screenshots (optional)

zhuyingda avatar Nov 29 '21 05:11 zhuyingda

Hey @zhuyingda I'm not sure if you know that Proxyman and Charles Proxy could not capture WS/WSS from the iOS app anymore since WS/WSS traffic doesn't go through the HTTP Proxy Server.

If you use WS/WSS from web browser, Proxyman can capture it as usual 👍

You can read more at: https://github.com/ProxymanApp/Proxyman/issues/586#issuecomment-720197948

Solution: Use Atlantis framework and capture WS/WSS (https://github.com/ProxymanApp/Proxyman/issues/586#issuecomment-821054334)

NghiaTranUIT avatar Nov 29 '21 05:11 NghiaTranUIT

@NghiaTranUIT I tried Chrome, Safari and the url https://echo.websocket.org. SSL is enabled. No wss:// in the list. Proxy overridden. How to troubleshoot this?

bubnov avatar Mar 29 '24 08:03 bubnov

@bubnov from what I see, https://echo.websocket.org/ is not a Websocket connection. You can see it in the Network Tab and Firefox. It's just a simple HTTPS Request.

As a result, Proxyman just displays as a HTTPS request/response.

CleanShot 2024-03-29 at 3  53 35@2x Screenshot 2024-03-29 at 3 54 53 PM

NghiaTranUIT avatar Mar 29 '24 08:03 NghiaTranUIT

@NghiaTranUIT I just used this comment as a reference https://github.com/ProxymanApp/Proxyman/issues/586#issuecomment-675834504

After we enable SSL-Proxying, Proxyman is able to read the header and understand that it's a WSS and handle the WSS traffic.

bubnov avatar Mar 29 '24 09:03 bubnov

It's from 2020, and https://echo.websocket.org doesn't send any WS/WSS traffic when accessing from Web Browser. If you use NodeJS to make a WS Connection to this server, it will work.

To use WS on web browser, please use this https://socketsbay.com/test-websockets

Screenshot 2024-03-29 at 4 06 52 PM

NghiaTranUIT avatar Mar 29 '24 09:03 NghiaTranUIT

@NghiaTranUIT Thanks for clarification. I managed to get it working with https://v3.piesocket.com/websocket-tester and in Chrome only. It is not working in Safari for some reason. Is it possible to capture websockets from Safari?

CleanShot 2024-03-29 at 11 15 36@2x

bubnov avatar Mar 29 '24 09:03 bubnov

from what I have experienced, Safari Websocket doesn't respect the system HTTP Proxy, it goes to the Internet without going to Proxyman.

NghiaTranUIT avatar Mar 29 '24 09:03 NghiaTranUIT

@NghiaTranUIT I see. I have no questions so far. Thanks for your help! :-)

bubnov avatar Mar 29 '24 09:03 bubnov