mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
MITM: Allow forwarding local negotiated ALPN http/1.1 to the real website
https://github.com/XTLS/Xray-core/issues/4348#issuecomment-2633656408 https://github.com/XTLS/Xray-core/issues/4348#issuecomment-2633865039 Local negotiated ALPN http/1.1 was sent by browser/app or is written in dokodemo-door RAW's `tlsSettings`. Set `"alpn": ["fromMitm"]` in freedom RAW's `tlsSettings` to forward it to the real website.
This commit is contained in:
parent
480c7d7db7
commit
9b7841178a
3 changed files with 27 additions and 1 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
"github.com/xtls/xray-core/features/policy"
|
||||
"github.com/xtls/xray-core/features/routing"
|
||||
"github.com/xtls/xray-core/transport/internet/stat"
|
||||
"github.com/xtls/xray-core/transport/internet/tls"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -90,6 +91,9 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn st
|
|||
addr := handshake.HandshakeAddressContext(ctx)
|
||||
if addr != nil {
|
||||
dest.Address = addr
|
||||
if conn.(*tls.Conn).ConnectionState().NegotiatedProtocol == "http/1.1" {
|
||||
ctx = session.ContextWithMitmAlpn11(ctx, true)
|
||||
}
|
||||
destinationOverridden = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue