ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.67k stars 187 forks source link

Long Websocket messages truncated #2021

Open markanderson-underdog opened 6 months ago

markanderson-underdog commented 6 months ago

Description

I'm using Proxyman to view sniff Websocket traffic where large json objects are passed between the client and server. If the json object is long enough which is being sent, the message is truncated.

Pasting what is displayed into an online character counter, it seems the exact number of characters displayed for me is 4066.

Steps to Reproduce

  1. Have the server send a message with very large json >5000 characters long (sorry, would supply one but my exact example is with company code I don't want to supply)
  2. View json in Proxyman for the WSS message

Current Behavior

After the 4066th character, no more of the message is displayed (and thus, it's improperly formatted json, so it isn't formatted)

Expected Behavior

Message in its entirety is displayed.

Environment

NghiaTranUIT commented 6 months ago

@markanderson-underdog may I ask if it's also truncated on your app too?

Or it just a display issue on Proxyman?

markanderson-underdog commented 6 months ago

@NghiaTranUIT Does not appear truncated in my app, just a visual display issue on Proxyman.

NghiaTranUIT commented 6 months ago

I'm not sure how to reproduce it, since it works on my test. Here is my setup

  1. Use Websocket NPM to make a WSS to wss://ws.postman-echo.com/raw, proxy to Proxyman
  2. Send a 5Mb JSON
  3. Able to see 5Mb JSON without truncating

Screenshot 2024-05-10 at 7 48 10 AM


May I ask:

  1. How big is your JSON in the websocket message?
  2. Do you know what your WS library is from your server?, is it a Websocket package by NodeJS, or Python, ... ? I'd like to investigate it

From what you describe, it doesn't affect your client, so the problem might be from the Proxyman side.

NghiaTranUIT commented 6 months ago

@markanderson-underdog can you show me the screenshot to demonstrate how it looks?

You can censor your sensitive data.

markanderson-underdog commented 6 months ago

Hey, sorry for the slow response.

My scenario looks similar to yours, but the issue I encounter is when the server is sending the message (so it's inbound, green arrow). You can see in the bottom that the json response arbitrarily cuts off in the middle of the content, not ending in a }. Similarly, I don't have line #s shown next to each line of the json message, because it doesn't get formatted (which make sense, as it isn't "proper json" since the end is truncated) so it's all just on line 1

Screenshot 2024-05-16 at 2 37 01 PM
NghiaTranUIT commented 5 months ago

I'm not sure how to reproduce it?

I tried again with a 5Mb JSON file in a single Websocket message from the Server and Client (See Video). It's working fine : /

https://github.com/ProxymanApp/Proxyman/assets/5878421/45bc8b63-fd6c-41bc-8c34-674b35607349


Can you open the Hex Tab and see if the date is fully received?

NghiaTranUIT commented 4 months ago

@markanderson-underdog can you this Beta build: https://download.proxyman.io/beta/Proxyman_5.5.0_Fix_monaco_editor_renders_a_long_line.dmg 🤔

markanderson-underdog commented 4 months ago

Hey, thank you for the build and message! Unfortunately, I'm still able to reproduce the issue on that build.

However, one bit of info I realize now I never included before which may potentially be relevant: our socket connections are using SignalR, which is slightly different than a vanilla socket connection. It's possible that may be involved? Can't say for sure though. Thank you!

NghiaTranUIT commented 4 months ago

@markanderson-underdog this can be a problem, our app is built with vanilla WS.