ProxymanApp / Proxyman

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

Node.js requests don't display in Proxyman #236

Open fishcharlie opened 5 years ago

fishcharlie commented 5 years ago

Proxyman version? (Ex. Proxyman 1.4.3)

Proxyman 1.4.7

macOS Version? (Ex. mac 10.14)

macOS 10.15 Beta (19A526h)

Steps to reproduce

  1. Open Proxyman
  2. Create request in Node.js (ex. https://github.com/axios/axios)
  3. Run Node.js script
  4. Observe that request doesn't display in Proxyman

Expected behavior

Request from Node.js to display in Proxyman

Screenshots (optional)

NA

gkatsanos commented 1 year ago

Thank you!

NghiaTranUIT commented 1 year ago

@Geczy I've fixed the ElectronJS issue, please get the Beta build from https://github.com/ProxymanApp/Proxyman/issues/1618#issuecomment-1528565327

Geczy commented 1 year ago

Can confirm it's fixed !

ChiuMungZitAlexander commented 1 year ago

My question is how can I disable it?

NghiaTranUIT commented 1 year ago

@ChiuMungZitAlexander Automatic Script doesn't start if you don't open the Terminal app. It only affects the current Terminal Session, not permanently change your OS. So, no need to disable it.

gkatsanos commented 1 year ago

Hey @NghiaTranUIT :


version 3.6.1
----------------------------------------------
------PROXYMAN AUTOMATIC SETUP SCRIPTS--------
----------------------------------------------
⭐️ Auto capture HTTP/HTTPS traffic from this Terminal app.
Support NodeJS: (axios, fetch, got, request, superagent)
Support Ruby: (http, net/http, net/https)
Support Python: (http, httplib, httplib2)

✅ Injected Proxyman variable environments to current shell

👉 Please start your local server or run your script from this Terminal.
set: +a: invalid variable name. See `help identifiers`

(Type 'help set' for related documentation)
 ✘  py[learning]  ~ 

I get this error when trying to open up a new 'automatic setup' terminal. I use

 fish -v
fish, version 3.6.1
gkatsanos commented 1 year ago

another issue I have (unrelated?) is even though I see one request, I dont see another one which happens to an external API endpoint but which passes through my VPN client.. could this be the reason?

NghiaTranUIT commented 1 year ago

@gkatsanos yes it can be a problem. If you're using fish, when opening the Automatic Setup Terminal -> Can you print the echo $PATH, to see if it contains the Proxyman path?

It's where Proxyman overrides the NodeJS env.

➜  ~ echo $PATH            
/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/overrides/path

The reason is: there is a small warning from your log.

set: +a: invalid variable name. See `help identifiers`
gkatsanos commented 1 year ago
 ✘  py[learning]  ~  echo $PATH         
/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/overrides/path /Users/gkatsanos/Library/pnpm /Users/gkatsanos/.pyenv/shims /opt/homebrew/Cellar/pyenv-virtualenv/1.2.1/shims /Users/gkatsanos/.pyenv/bin /Users/gkatsanos/.nvm/versions/node/v16.19.0/bin /Users/gkatsanos/.rbenv/shims /Users/gkatsanos/.pyenv/bin /opt/homebrew/bin /usr/local/bin /Users/gkatsanos/.yarn/bin /usr/bin /bin /usr/sbin /sbin
 py[learning]  ~  
leohxj commented 1 year ago

add export NODE_TLS_REJECT_UNAUTHORIZED=0 after manual setup.

NghiaTranUIT commented 1 year ago

@leohxj a Beta build for you: https://download.proxyman.io/beta/Proxyman_4.11.0_Improve_UI_v1.dmg

Changelog

leohxj commented 1 year ago

thanks @NghiaTranUIT , it works well

shirshak55 commented 1 year ago

actually I don't recommend this. Last week , I think from Egypt government was hacked because of http. Although, you may not be the target, I don't recommend messing with security.

I think proxy man should explicitly ask if they want to reduce this security?

NghiaTranUIT commented 1 year ago

@shirshak55 it doesn't globally modify your entire system. It only takes effect on the current Terminal app session when you need to debug your NodeJS project.

leohxj commented 1 year ago

yes, only for develop and use it locally

tonyxiao commented 11 months ago

Does this work with the built in node.js fetch now? Or is the node-fetch 3rd party lib required to use with proxyman?

NghiaTranUIT commented 11 months ago

It works for both. Native fetch and node-fetch

tonyxiao commented 11 months ago

Which env variable does native fetch use? When I look at the node docs it seems that fetch doesn't support proxy / agent agt all.

NghiaTranUIT commented 11 months ago

Auto Setup from Proxyman does more things than just the env. Proxyman uses global-agent to auto override the proxy of NodeJS Fetch in runtime.

You simply:

  1. Open Proxyman, make sure you setup the certificate properly in Certificate menu -> Install for Mac.
  2. Setup menu -> Auto -> start the Termnial.
  3. Run your NodeJS script and this terminal and it's done ✅
tonyxiao commented 11 months ago

Hmm but the global-agent lib doesn't actually seem to support node 18 fetch. @see https://github.com/gajus/global-agent/issues/52 Does proxyman use the undici workaround too?

NghiaTranUIT commented 11 months ago

Hmm but the global-agent lib doesn't actually seem to support node 18 fetch. @see gajus/global-agent#52 Does proxyman use the undici workaround too?

Yes, it's.

NghiaTranUIT commented 1 week ago

FYI: We can capture all HTTPS Traffic from NodeJS with the Auto Setup (https://docs.proxyman.io/debug-devices/nodejs)

No need to config the Proxy or manually trust the self-signed certificate on your NodeJS code 👍