Proxyman
Proxyman copied to clipboard
Wrong target host is used although raw HTTP request shows the right target host
Description
This is really strange.
I am using Proxyman on macOS all the time without any issues. Now, I have a node.js app that uses axios to talk to OpenAI API and Spotify API.
I get a 403 on a request that should go to Spotify but actually goes to OpenAI, using the token meant for Spotify. Obviously, OpenAI gives me a 403.
If I disable proxying for the node.js app, everything works fine. If I use Charles proxy, everything works fine.
I am lost... ;-)
Environment
- App version: e.g Proxyman 4.11.0
- macOS version: Ventura 13.5.2
@ChristianWeyer do you use any Debugging Tools that modify the Request Header?
By default, Proxyman doesn't change any Request/Response data, each request is a separate tunnel, so it doesn't affect to other requests/responses. It means that the Host: api.spotify.com issue is likely from the client side, not Proxyman.
Can you double-check it on your side?
Hi @NghiaTranUIT - nope, I am going straight from the TypeScript/JS code via Proxyman to the target URLs. It works with other debugging proxy tools. This is why I am so confused...
FYI: this is the code I am using in this case: https://github.com/microsoft/TypeChat/tree/main/examples/music
E.g., this is a line in the code that seems to fail (according to the screenshot above): https://github.com/microsoft/TypeChat/blob/ec3a37c44168ff5d3fef954a62278e205a3bab4f/examples/music/src/endpoints.ts#L445
I have a similar issue. Different hosts switching.
When I quit proxyman, things work fine. This is very frustrating.
It's odd. Let's me investigate it 👍
@mattruby do you use any debugging tool that might change the host? (such as Map Remote, Breakpoint or Scripting)
By default, Proxyman doesn't change the host, and Proxyman makes a connection by the Host Header, so I'm not sure why it can happen 🤔
I have PIA with a dedicated IP in the mix. It really makes no sense. I'm happy to hop on a screen share and show you what's happening. I've tried resetting everything in proxyman.
I'm using axios in a nest.js app. I'm pointing it at the proxy using this: export https_proxy=http://192.168.68.126:9090 http_proxy=http://192.168.68.126:9090
This is the correct endpoint being proxied and called:
For some reason, those introspect calls seem to leak into the cart service:
With export NODE_DEBUG=http,http
I can see that I'm trying to call the correct endpoint:
Is there a way for me to send you a debug log or anything? I'm happy to do so. ProxyMan has saved me so much time!
I wonder if axios is the problem? https://github.com/axios/axios/issues/5725 looks like it's worth looking into.
Here's another interesting axios proxy issue: https://github.com/axios/axios/pull/3159
When I set the env params to what proxyman provides: export https_proxy=http://192.168.68.128:9090 http_proxy=http://192.168.68.128:9090 both entries are http.
@mattruby I believe that it's from Axios because there are some people has encountered issue on Axios too.
From what I see on your screenshot, you don't have any debugging tool, so Proxyman won't modify your URL.