diff --git a/api/newV2board/v2board.go b/api/newV2board/v2board.go index 24b27a0e..6d91da47 100644 --- a/api/newV2board/v2board.go +++ b/api/newV2board/v2board.go @@ -491,6 +491,18 @@ func (c *APIClient) parseV2rayNodeResponse(s *serverConfig) (*api.NodeInfo, erro } else { host = "www.example.com" } + case "httpupgrade", "splithttp": + if s.NetworkSettings.Headers != nil { + if httpHeaders, err := s.NetworkSettings.Headers.MarshalJSON(); err != nil { + return nil, err + } else { + b, _ := simplejson.NewJson(httpHeaders) + host = b.Get("Host").MustString() + } + } + if s.NetworkSettings.Host != "" { + host = s.NetworkSettings.Host + } } if s.Tls != 0 { diff --git a/go.mod b/go.mod index a7399349..ec66451a 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 - github.com/xtls/xray-core v1.8.19 + github.com/xtls/xray-core v1.8.21-0.20240720172606-57248d34013e golang.org/x/crypto v0.25.0 golang.org/x/net v0.27.0 golang.org/x/time v0.5.0 diff --git a/go.sum b/go.sum index f1bc133d..3d2f1b21 100644 --- a/go.sum +++ b/go.sum @@ -1742,6 +1742,8 @@ github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhig github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE= github.com/xtls/xray-core v1.8.19 h1:mml7smcO2FM5HyyKdqnf5F2BUvi3br2ldrqmeemEFRE= github.com/xtls/xray-core v1.8.19/go.mod h1:0CwyMPNA5Cs+ukPXHbYQGgne/ug0PuXOSVqBu7zyXOc= +github.com/xtls/xray-core v1.8.21-0.20240720172606-57248d34013e h1:kqWViuGYCBLMkIchaA8gaoKcUoy/8Lb5m1b1eETqAmQ= +github.com/xtls/xray-core v1.8.21-0.20240720172606-57248d34013e/go.mod h1:0CwyMPNA5Cs+ukPXHbYQGgne/ug0PuXOSVqBu7zyXOc= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yandex-cloud/go-genproto v0.0.0-20240311082839-58e1a7554a75 h1:hkFRBcSOFUNuuORzA5DqvBcoFjH7R0HCIu+mlSSw56U= diff --git a/service/controller/inboundbuilder.go b/service/controller/inboundbuilder.go index e14f66f8..e401f430 100644 --- a/service/controller/inboundbuilder.go +++ b/service/controller/inboundbuilder.go @@ -199,6 +199,12 @@ func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.I AcceptProxyProtocol: nodeInfo.AcceptProxyProtocol, } streamSetting.HTTPUPGRADESettings = httpupgradeSettings + case "splithttp": + splithttpSetting := &conf.SplitHTTPConfig{ + Path: nodeInfo.Path, + Host: nodeInfo.Host, + } + streamSetting.SplitHTTPSettings = splithttpSetting } streamSetting.Network = &transportProtocol