mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-17 04:34:40 +03:00
add header for httpupgrade
This commit is contained in:
@@ -231,8 +231,13 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string {
|
||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||
obj["path"] = httpupgrade["path"].(string)
|
||||
obj["host"] = httpupgrade["host"].(string)
|
||||
if headers, ok := httpupgrade["headers"].(map[string]interface{}); ok {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
obj["host"] = hostFromHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
security, _ := stream["security"].(string)
|
||||
obj["tls"] = security
|
||||
if security == "tls" {
|
||||
@@ -347,8 +352,8 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
||||
case "ws":
|
||||
ws, _ := stream["wsSettings"].(map[string]interface{})
|
||||
params["path"] = ws["path"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
params["host"] = ws["host"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
@@ -376,8 +381,14 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||
params["path"] = httpupgrade["path"].(string)
|
||||
params["host"] = httpupgrade["host"].(string)
|
||||
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
params["host"] = hostFromHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
security, _ := stream["security"].(string)
|
||||
if security == "tls" {
|
||||
params["security"] = "tls"
|
||||
@@ -570,8 +581,8 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
||||
case "ws":
|
||||
ws, _ := stream["wsSettings"].(map[string]interface{})
|
||||
params["path"] = ws["path"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
params["host"] = ws["host"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
@@ -599,8 +610,14 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||
params["path"] = httpupgrade["path"].(string)
|
||||
params["host"] = httpupgrade["host"].(string)
|
||||
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
params["host"] = hostFromHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
security, _ := stream["security"].(string)
|
||||
if security == "tls" {
|
||||
params["security"] = "tls"
|
||||
@@ -794,8 +811,8 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st
|
||||
case "ws":
|
||||
ws, _ := stream["wsSettings"].(map[string]interface{})
|
||||
params["path"] = ws["path"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
params["host"] = ws["host"].(string)
|
||||
headers, _ := ws["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
@@ -823,6 +840,13 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st
|
||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||
params["path"] = httpupgrade["path"].(string)
|
||||
params["host"] = httpupgrade["host"].(string)
|
||||
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||
if headers != nil {
|
||||
hostFromHeaders := searchHost(headers)
|
||||
if hostFromHeaders != "" {
|
||||
params["host"] = hostFromHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
security, _ := stream["security"].(string)
|
||||
|
||||
Reference in New Issue
Block a user