mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-10 05:38:52 +00:00
Finalmask: Add header-custom (TCP & UDP), fragment (TCP), noise (UDP); Support dialer-proxy, XHTTP/3; Fix XDNS, XICMP potential panic (#5657)
https://github.com/XTLS/Xray-core/pull/5657#issuecomment-4016609446
This commit is contained in:
@@ -463,6 +463,16 @@ func ListenXH(ctx context.Context, address net.Address, port net.Port, streamSet
|
||||
if err != nil {
|
||||
return nil, errors.New("failed to listen UDP for XHTTP/3 on ", address, ":", port).Base(err)
|
||||
}
|
||||
|
||||
if streamSettings.UdpmaskManager != nil {
|
||||
pktConn, err := streamSettings.UdpmaskManager.WrapPacketConnServer(Conn)
|
||||
if err != nil {
|
||||
Conn.Close()
|
||||
return nil, errors.New("mask err").Base(err)
|
||||
}
|
||||
Conn = pktConn
|
||||
}
|
||||
|
||||
l.h3listener, err = quic.ListenEarly(Conn, tlsConfig, nil)
|
||||
if err != nil {
|
||||
return nil, errors.New("failed to listen QUIC for XHTTP/3 on ", address, ":", port).Base(err)
|
||||
@@ -511,6 +521,10 @@ func ListenXH(ctx context.Context, address net.Address, port net.Port, streamSet
|
||||
errors.LogInfo(ctx, "listening TCP for XHTTP on ", address, ":", port)
|
||||
}
|
||||
|
||||
if !l.isH3 && streamSettings.TcpmaskManager != nil {
|
||||
l.listener, _ = streamSettings.TcpmaskManager.WrapListener(l.listener)
|
||||
}
|
||||
|
||||
// tcp/unix (h1/h2)
|
||||
if l.listener != nil {
|
||||
if config := tls.ConfigFromStreamSettings(streamSettings); config != nil {
|
||||
|
||||
Reference in New Issue
Block a user