[GH-ISSUE #226] [BUG] Unable to capture any request from localhost #221

Open
opened 2026-03-03 19:16:21 +03:00 by kerem · 5 comments
Owner

Originally created by @NghiaTranUIT on GitHub (Jul 19, 2019).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/226

Originally assigned to: @NghiaTranUIT on GitHub.

🐶 Brief

There are some users encountered the issue that Proxyman couldn't capture any request from Safari when navigating to localhost:3000, but it work if it's has alias in etc/hosts

Let check it out!

👑 Criteria

  • Able to capture any request to localhost:xxxx
Originally created by @NghiaTranUIT on GitHub (Jul 19, 2019). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/226 Originally assigned to: @NghiaTranUIT on GitHub. ## 🐶 Brief There are some users encountered the issue that Proxyman couldn't capture any request from Safari when navigating to `localhost:3000`, but it work if it's has alias in `etc/hosts` Let check it out! ## 👑 Criteria - [x] Able to capture any request to localhost:xxxx
Author
Owner

@NghiaTranUIT commented on GitHub (Jul 19, 2019):

It turns out that macOS is hardcoded that localhost will not use proxy, so when we connect to localhost from Safari/Chrome, it doesn't appear on Proxyman.

There are two workaround approaches:

  1. Add 127.0.0.1 <yourdomain> in /etc/host, then using new alias domains for testing.
    Ex:
# /etc/host
127.0.0.1	proxyman.dev

Then open proxyman.dev:3000 in Safari -> All requests are recored in Proxyman app.

  1. Use Paw, Insomnia REST Client, curl with overridden Proxy configs.
    Ex:
  • Paw: Preferences -> Network -> Enable HTTP/HTTPS Proxy
  • Insomnia: Preferences -> Enable HTTP/HTTPS Proxy
  • curl: with proxy config -x http://localhost:9090
<!-- gh-comment-id:513285849 --> @NghiaTranUIT commented on GitHub (Jul 19, 2019): It turns out that macOS is hardcoded that `localhost` will not use proxy, so when we connect to `localhost` from Safari/Chrome, it doesn't appear on Proxyman. There are two workaround approaches: 1. Add `127.0.0.1 <yourdomain>` in `/etc/host`, then using new alias domains for testing. Ex: ``` # /etc/host 127.0.0.1 proxyman.dev ``` Then open `proxyman.dev:3000` in Safari -> All requests are recored in Proxyman app. 2. Use Paw, Insomnia REST Client, curl with overridden Proxy configs. Ex: - Paw: Preferences -> Network -> Enable HTTP/HTTPS Proxy - Insomnia: Preferences -> Enable HTTP/HTTPS Proxy - curl: with proxy config `-x http://localhost:9090`
Author
Owner

@hanh090 commented on GitHub (Feb 26, 2021):

I just follow this instruction to update etc/host in Catalina, but seems the alias do not work. Because I'm too lazy to deep dive and solve problem with alias mapping in MacOS :), I wonder can we implement a solution like Charles as mentioned here: https://www.charlesproxy.com/documentation/faqs/localhost-traffic-doesnt-appear-in-charles/ ?
Right now, my temporary workaround is install Charles to fix alias problem and use proxy man to do other stuff

<!-- gh-comment-id:786940231 --> @hanh090 commented on GitHub (Feb 26, 2021): I just follow this instruction to update `etc/host` in Catalina, but seems the alias do not work. Because I'm too lazy to deep dive and solve problem with alias mapping in MacOS :), I wonder can we implement a solution like Charles as mentioned here: https://www.charlesproxy.com/documentation/faqs/localhost-traffic-doesnt-appear-in-charles/ ? Right now, my temporary workaround is install Charles to fix alias problem and use proxy man to do other stuff
Author
Owner

@hanh090 commented on GitHub (Feb 27, 2021):

I found explanation. Charles was register a DNS localhost.charlesproxy.com with IP is 127.0.0.1. Ref: https://stackoverflow.com/a/35002561/1743046. So, we do not need to install Charles in our computer, just replace localhost by localhost.charlesproxy.com in address bar then voila, everything works as expected :)

<!-- gh-comment-id:786991427 --> @hanh090 commented on GitHub (Feb 27, 2021): I found explanation. Charles was register a DNS `localhost.charlesproxy.com` with IP is `127.0.0.1`. Ref: https://stackoverflow.com/a/35002561/1743046. So, we do not need to install Charles in our computer, just replace `localhost` by `localhost.charlesproxy.com` in address bar then voila, everything works as expected :)
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 27, 2021):

nice, I didn't that Charles Proxy does this trick 👍

I will support this useful feature soon 😄 I'm currently working the Network Throttling #119

<!-- gh-comment-id:786991669 --> @NghiaTranUIT commented on GitHub (Feb 27, 2021): nice, I didn't that Charles Proxy does this trick 👍 I will support this useful feature soon 😄 I'm currently working the Network Throttling #119
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 28, 2021):

Thank @hanh090 for the trick. I've updated the Doc for anyone concern 🌮

<!-- gh-comment-id:787428763 --> @NghiaTranUIT commented on GitHub (Feb 28, 2021): Thank @hanh090 for the trick. I've updated the Doc for anyone concern 🌮 - https://docs.proxyman.io/troubleshooting/couldnt-see-any-request-from-localhost-server#3-1-use-localhost-proxyman-io
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#221
No description provided.