ProxymanApp / Proxyman

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

zstd compression support #1513

Open aexvir opened 1 year ago

aexvir commented 1 year ago

Description

we're using zstd compression between some of our services, and currently in proxyman I'm only able to visualize the binary data for the response body; other content encodings like gzip seem to be supported, so I'm guessing this is a feature request and not a bug

Why this feature/change is important?

currently I'm forced to always download the request body to disk and then use the zstd cli to obtain plain text that I can use to debug what's going on, which slows me down

thanks for developing this app! 🙂

NghiaTranUIT commented 1 year ago

Thanks for opening the ticket.

Does the zstd is defined in the Header Content Encoding?

aexvir commented 1 year ago

yep! Content-Encoding: zstd

NghiaTranUIT commented 1 year ago

You can do a quick hack, by removing the Accept-Encoding in the Request -> Your server doesn't compress with the zstd -> You can preview it on Proxyman -> Your client can get the uncompressed data since the Content-Encoding is omit.

You can use the Scripting with On Request mode:

function onRequest(context, url, request) {
    delete request.headers["Accept-Encoding"];
    return request;
}
aexvir commented 1 year ago

nice! I haven't used the scripting feature on proxyman yet, so I didn't think about this use case I got it working, thanks for the suggestion, but if at some point zstd support could be added I think that would be nice 🙂

rockmandash commented 3 months ago

You can do a quick hack, by removing the Accept-Encoding in the Request -> Your server doesn't compress with the zstd -> You can preview it on Proxyman -> Your client can get the uncompressed data since the Content-Encoding is omit.

You can use the Scripting with On Request mode:

function onRequest(context, url, request) {
    delete request.headers["Accept-Encoding"];
    return request;
}

I spent whole day finally found this! This is pro tip! It should be directly baked into example starter code!

NghiaTranUIT commented 3 months ago

Glad it helps you @rockmandash 👍