I couldn't see any requests from my localhost server

1. Problems

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

  • I'm developing a local server that make requests to the Internet, but none of them show on 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 Proxyman app.

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

3. Solutions

Map localhost to 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:8080 (replace 8080 with your localhost ports)

5. Enjoy debugging!