NodeJS
Capture HTTP/HTTPS traffic from NodeJS with Proxyman
Last updated
Capture HTTP/HTTPS traffic from NodeJS with Proxyman
Last updated
Proxyman v4.7.0 or later can capture HTTP/HTTPS traffic from NodeJS with 1-click.
1-click solution: No need to manually set HTTP Proxy config or trust the self-signed certificate.
Support many NodeJS libraries: axios, got, superagent, fetch, and node-fetch
Open Proxyman -> Setup Menu -> Automatic Setup
Click on "Open New Terminal"
Accept the Apple Script permission prompt if needed
The New Terminal app is launched -> You can start your NodeJS Backend Server, or Run scripts => Proxyman automatically captures all traffic.
For example:
Done ✅
Please check out the Automatic Setup page:
Automatic SetupThere are common problems when using NodeJS + Proxyman:
If you're using NodeJS to serve a localhost website (e.g http://localhost:3000), Proxyman might not work. For example: Use ExpressJS to serve an API Server at http://localhost:3000
Please check out this solution.
Get SSL Error from HTTPS Requests
By default, all HTTP/HTTPS requests which are called from your NodeJS library don't go through HTTP Proxy Server. Thus, Proxyman could not capture the traffic.
Install global-agent package
2. At the top of your NodeJS code, add the following code:
3. Add this env to your current bash. Make sure Proxyman is listening at port 9090
4. Done ✅
Run your NodeJS Script again and the HTTP/HTTPS request would appear on the Proxyman app.
According to Axios Documentation, we can simply provide the HTTP_PROXY and HTTPS_PROXY environment.
Click on the Proxyman Status Menu
Copy Shell Command
Open the Terminal and run the paste content: For example export https_proxy=http://192.168.1.103:9090 http_proxy=http://192.168.1.103:9090
On the same Terminal -> Start your NodeJS Server with axios.
Axios will proxy the traffic to Proxyman.
Done ✅
If you're not using fetch or axios, the configuration might be different. Please check out your lib Document to see how to set the proxy and trust the Proxyman certificate.
Discussion at https://github.com/ProxymanApp/Proxyman/issues/236