Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxying localhost http requests is not working. #2251

Open
nextdimension opened this issue Feb 9, 2025 · 10 comments
Open

Proxying localhost http requests is not working. #2251

nextdimension opened this issue Feb 9, 2025 · 10 comments
Labels
question Further information is requested

Comments

@nextdimension
Copy link

nextdimension commented Feb 9, 2025

intercepting localhost does not work.
i've removed the filter in the proxy settings.
i've tried using localhost.proxyman.io.
i've even set the value in the hosts file.
i'm on macos, latest version, fully updated.

either i'm doing something wrong proxyman is broken

@nextdimension nextdimension added the question Further information is requested label Feb 9, 2025
@NghiaTranUIT
Copy link
Member

You should edit the host file, so Proxyman can capture your localhost traffic, for example: http://localhost:3000

The reason is that no local traffic uses the proxy. It's how macOS works, and it's not a bug from Proxyman

@nextdimension
Copy link
Author

nextdimension commented Feb 9, 2025

I already wrote...

'i've even set the value in the hosts file.'

i followed your docs.

https://docs.proxyman.com/troubleshooting/couldnt-see-any-request-from-localhost-server#3-1-use-localhost-proxyman-io

@NghiaTranUIT
Copy link
Member

Just tested: http://localhost.proxyman.io:4000 works fine. It capture localhost:4000

Image

@NghiaTranUIT
Copy link
Member

NghiaTranUIT commented Feb 9, 2025

can you share your host file? and your URL?

It's difficult to debug if you don't share anything except it didn't work

@nextdimension
Copy link
Author

Host Database

localhost is used to configure the loopback interface

when the system is booting. Do not change this entry.

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 proxyman.debug
::1 proxyman.debug

I have a service running on localhost:8080
I am making a GET request using CURL to:

localhost:8080 and/or localhost.proxyman.io:8080
niether appear in proxyman GUI

@NghiaTranUIT
Copy link
Member

ok, the problem is cURL doesn't use HTTP Proxy. It goes to the Internet.

Try

curl -v http://proxyman.debug:8080 --proxy localhost:9090

Or access it from Safari:

http://proxyman.debug:8080

@NghiaTranUIT
Copy link
Member

if you don't want to use --proxy flag, just open Proxyman -> Setup Menu -> Automatic Setup -> New Terminal -> Run your cURL here. It auto proxies to Proxyman

@nextdimension
Copy link
Author

nextdimension commented Feb 9, 2025

ok, so the problem for me is, I want to capture all the http traffic. Not just the browser and some apps are curl wrappers, like postman.

I have a nodejs service that makes requests to lcoalhost:8080 and this is what I want to capture the traffiic for.

So proxyman can only capture browser traffic?

@NghiaTranUIT
Copy link
Member

it's tricky to capture NodeJS requests, but Proxyman can work with 1 click by using the Automatic Setup that I show you in the previous chat.

Works with NodeJS: Axios, got, superagent, fetch, and node-fetch.

  1. Open Proxyman -> Setup Menu -> Automatic Setup -> New Terminal
  2. On this Terminal -> Start your NodeJS server
  3. Proxyman will capture all request from your NodeJS server, for example axios

@nextdimension
Copy link
Author

nextdimension commented Feb 9, 2025

ok, I will try. thank you for the help.
Maybe easier to use wireshark :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants