I couldn't see any requests from my localhost server

1. Problems

  • I'm running a localhost server at port 3000, but I couldn't see any traffics from the Proxyman app

  • I'm developing a local server that makes requests to the Internet, but none of them show on the Proxyman app

2. Why does it happen?

By default, all localhost traffics won't go through HTTP/HTTPS Proxy on macOS, so we couldn't see any requests or responses on the Proxyman app.

If you're using a 3rd-party Networking library, such as curl, java, axios, ... The traffic might not go through the HTTP Proxy by default. Please check this Doc

3. Solutions

Map localhost to the domain name in /etc/hosts

  1. Open etc/hosts file

$ sudo vim /etc/hosts

2. Add Domain Name:

Ex: my-website.dev or my-website.dev

3. Save the file

4. Access your localhost server by http://proxyman.dev:3000 (replace 3000 with your localhost ports)

5. Enjoy debugging!