ProxymanApp / Proxyman

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

How to use with command line tools? #175

Open andrewhavens opened 5 years ago

andrewhavens commented 5 years ago

Which Proxyman version are you using? (Ex. Proxyman 0.5 (200))

Proxyman 1.4.1.1 (1411)

What OS Version are you using? (Ex. mac 10.13)

Mac 10.14.5

Steps to reproduce this issue

Trying to use Proxyman to inspect HTTPS requests being made from a command line tool. Requests weren't being logged automatically, so I manually configured the tool to use Proxyman as the proxy using a URL of http://localhost:9090. However, it is failing on trusting the Proxyman Certificate. The tool allows for specifying a directory of CA certs, but I wasn't sure what directory that would be.

NghiaTranUIT commented 5 years ago

Hey @andrewhavens

  1. curl or some command line tools doesn't often go through Proxyman at port 9090, so we have to enable it explicitly. For example: curl require this param -x http://localhost:9090

  2. Can you help me to answer some questions, so I could investigate what is wrong

    • Have you install and trust Proxyman Certificate in Proxyman yet (Certificate menu -> Install Cert on this mac)?
    • Are you able to incept any request? To make sure Proxyman works, and only has problems with your tool.
    • If you would like to specify the CA. You could find it at ~/.proxyman. All you need are here, if you've installed CA properly.

Let me know if you need some help ☕️

andrewhavens commented 5 years ago

Thanks @NghiaTranUIT! I was able to specify the CA file that is located at ~/.proxyman/proxyman-ca.pem and it worked.

NghiaTranUIT commented 5 years ago

Glad to hear that 👍

psimoneau22 commented 5 years ago

I have something similar. We have Application code written with C# and dotnet. When using the httpClient in the dotnet framework, requests do not go through the proxy. Is there anything that can be done without explicitly changing the application code's httpClient to use the proxy? On a windows machine using Fiddler, this just automatically works without having to change any application code. I can see all my requests going through the fiddler proxy.

Edit, I might be wrong about windows automatically doing it, but here is what the fiddler docs say https://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureDotNETApp

Btw great job so far, keep on going. I use fiddler extensively on windows and I am (and I know many other people who are) looking for the same basic functionality on Mac.

NghiaTranUIT commented 5 years ago

Technically, when Proxyman launches, it will automatically override the HTTP/HTTPS Proxy in Network System (You can see in System Preference -> Network -> Wifi -> Advanced -> Proxy). Therefore, all requests are automatically proxying to Proxyman -> Appear on the app.

However, some apps don't respect that rule until we explicitly config in their apps. For instance:

So, I guess there is two scenarios:

  1. If we open Proxyman, but there is no requests a alls, no Proxy Overridden in Network System => It indicates a bug 🐛
  2. If other requests appear (Open Safari or Chrome) too see, but there is no request from your app => It means that we have to explicitly config the Proxy in your source code. Like Android or even .NET app

@psimoneau22 let me know what situation you're 🌮

Thank you in advance 😄

psimoneau22 commented 5 years ago

situation #2

I am good, we will just have to add some code to our apps (conditionally) when we want to debug through proxyman. Thank you for your help.

NghiaTranUIT commented 5 years ago

Glad to hear that @psimoneau22 👍 🌮 😄