Skip to content

Commit

Permalink
add splithttp
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmray committed Jun 26, 2024
1 parent 3dd388c commit cc18554
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion xray/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (t *Trojan) DetailsStr() string {

if copyV.Type == "" {

} else if copyV.Type == "http" || copyV.Type == "httpupgrade" || copyV.Type == "ws" || copyV.Type == "h2" {
} else if copyV.Type == "http" || copyV.Type == "httpupgrade" || copyV.Type == "ws" || copyV.Type == "h2" || copyV.Type == "splithttp" {
info += fmt.Sprintf("%s: %s\n%s: %s\n",
color.RedString("Host"), copyV.Host,
color.RedString("Path"), copyV.Path)
Expand Down Expand Up @@ -221,6 +221,11 @@ func (t *Trojan) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDe
Host: t.Host,
Path: t.Path,
}
case "splithttp":
s.SplitHTTPSettings = &conf.SplitHTTPConfig{
Host: t.Host,
Path: t.Path,
}
case "grpc":
if len(t.ServiceName) > 0 {
if t.ServiceName[0] == '/' {
Expand Down
8 changes: 7 additions & 1 deletion xray/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (v *Vless) DetailsStr() string {
color.RedString("Flow"), copyV.Flow)
if copyV.Type == "" {

} else if copyV.HeaderType == "http" || copyV.Type == "httpupgrade" || copyV.Type == "ws" || copyV.Type == "h2" {
} else if copyV.HeaderType == "http" || copyV.Type == "httpupgrade" || copyV.Type == "ws" || copyV.Type == "h2" || copyV.Type == "splithttp" {
info += fmt.Sprintf("%s: %s\n%s: %s\n",
color.RedString("Host"), copyV.Host,
color.RedString("Path"), copyV.Path)
Expand Down Expand Up @@ -231,6 +231,12 @@ func (v *Vless) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDet
Path: v.Path,
}
break
case "splithttp":
s.SplitHTTPSettings = &conf.SplitHTTPConfig{
Host: v.Host,
Path: v.Path,
}
break
case "grpc":
if len(v.ServiceName) > 0 {
if v.ServiceName[0] == '/' {
Expand Down
5 changes: 5 additions & 0 deletions xray/vmess.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ func (v *Vmess) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDet
Host: v.Host,
Path: v.Path,
}
case "splithttp":
s.SplitHTTPSettings = &conf.SplitHTTPConfig{
Host: v.Host,
Path: v.Path,
}
case "grpc":
if len(v.Path) > 0 {
if v.Path[0] == '/' {
Expand Down

0 comments on commit cc18554

Please sign in to comment.