-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
hysteria2 masquerade options updated to let modern websites load correctly #2297
base: dev-next
Are you sure you want to change the base?
Conversation
9443c94
to
013a69c
Compare
3c5c2b6
to
fd806af
Compare
Maybe we need to add a new option for this, since this is the default behavior of hysteria2: https://github.com/apernet/hysteria/blob/15e31d48a09af0835773bd5c62cedbb3fc0e351d/app/cmd/server.go#L815 |
940d78e
to
d3d7664
Compare
29fb3f8
to
d5162dc
Compare
Thank you for mentioning this code. This PR updates the |
Docs and unit test updated also |
9993502
to
3613e2a
Compare
3613e2a
to
fff0f96
Compare
b82b7c0
to
ba61de4
Compare
ba61de4
to
d9d8567
Compare
It seems my pull request was refactored in this commit. I’m glad to see that! |
1aa1333
to
2d4c4e2
Compare
Removed
r.Out.Host = r.In.Host
to resolve an issue where the proxy was incorrectly using the client's host header instead of the target's host. This ensures the proxy request aligns with the intended masquerade behavior.API Document
https://pkg.go.dev/net/http/httputil#ProxyRequest.SetURL
Currently the code line
r.Out.Host = r.In.Host
is used forpreserve the inbound request's Host header
which is sing-box server's host name in our situation.Sample Code
A go proxy sample here for occurring this bug:
The bad result:
After removed
r.Out.Host = r.In.Host
, it seems works properly.