Skip to content

Commit

Permalink
fix: the path of ws when using 0-rtt feature in django-sspanel
Browse files Browse the repository at this point in the history
  • Loading branch information
crossfw committed Dec 24, 2021
1 parent 15b5da9 commit 9f32d48
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/DjangoSSPanelAPI/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/crossfw/Air-Universe/pkg/structures"
"io/ioutil"
"net/http"
"strings"
"time"
)

Expand Down Expand Up @@ -81,7 +82,14 @@ func parseVmessRawInfo(rtnJson *simplejson.Json, node *structures.NodeInfo, clos

switch node.TransportMode {
case "ws":
node.Path = inboundInfo.Get("streamSettings").Get("wsSettings").Get("path").MustString()
wsPath := inboundInfo.Get("streamSettings").Get("wsSettings").Get("path").MustString()
realPathIndex := strings.Index(wsPath, "?")

if realPathIndex != 0 {
node.Path = string([]byte(wsPath)[0:realPathIndex])
} else {
node.Path = wsPath
}
//node.Host = inboundInfo.Get("streamSettings").Get("wsSettings").Get("headers").Get("Host").MustString()
if closeTLS == false {
node.EnableTLS = true
Expand Down

0 comments on commit 9f32d48

Please sign in to comment.