REALITY: Unblock SplitHTTP transport (#3816)

https://github.com/XTLS/Xray-core/pull/3816#issuecomment-2445694775
This commit is contained in:
mmmray authored and GitHub committed 2024-10-30 02:31:05 +00:00
1 parent 9f8bb47633
commit e733148c0b
3 files changed
+30 -6

No files matched your search

+6
View File
@@ -13,12 +13,14 @@ import (
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/http3"
goreality "github.com/xtls/reality"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net"
http_proto "github.com/xtls/xray-core/common/protocol/http"
"github.com/xtls/xray-core/common/signal/done"
"github.com/xtls/xray-core/transport/internet"
"github.com/xtls/xray-core/transport/internet/reality"
"github.com/xtls/xray-core/transport/internet/stat"
v2tls "github.com/xtls/xray-core/transport/internet/tls"
"golang.org/x/net/http2"
@@ -344,6 +346,10 @@ func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSet
}
}
if config := reality.ConfigFromStreamSettings(streamSettings); config != nil {
listener = goreality.NewListener(listener, config.GetREALITYConfig())
}
// h2cHandler can handle both plaintext HTTP/1.1 and h2c
h2cHandler := h2c.NewHandler(handler, &http2.Server{})
l.listener = listener