You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the network panel, click httpxy and http-proxy buttons to both fetch https://baidu.com (the Chinese largest search engine, I just use it as an example).
httpxy response with a 405(❌), and the http-proxy response with a 302(✅).
I have verified it's the Host that caused the wrong response(maybe some check by baidu.com),
When using httpxy, the request Host is baidu.com:443
Environment
nodejs: v20.12.0
httpxy: v0.1.5(latest)
Reproduction
stackblitz - reporduciton
You have to download this project to run locally (Some TLS error prevents it from running in Stackblitz).
Describe the bug
/api/httpxy
is usinghttpxy
(this repo)/api/http-proxy
is using node-http-proxyhttpxy
andhttp-proxy
buttons to both fetch https://baidu.com (the Chinese largest search engine, I just use it as an example).httpxy
response with a405
(❌), and thehttp-proxy
response with a302
(✅).I have verified it's the
Host
that caused the wrong response(maybe some check by baidu.com),httpxy
, the requestHost
isbaidu.com:443
Caused by this:
httpxy/src/_utils.ts
Lines 108 to 110 in 07778fb
http-proxy
, the requestHost
isbaidu.com
I'm not saying Baidu's strategy in the response, I just wonder why we add the
port
to theHost
, it might break some other sites as well.Sorry to disturb if anything I misunderstood ❤️.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: