diff --git a/web/service/xray.go b/web/service/xray.go index 668d6952..8a738b04 100644 --- a/web/service/xray.go +++ b/web/service/xray.go @@ -106,6 +106,13 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) { // clear client config for additional parameters var final_clients []interface{} + + // detect inbound transmission type + var stream map[string]interface{} + json.Unmarshal([]byte(inbound.StreamSettings), &stream) + network, _ := stream["network"].(string) + security, _ := stream["security"].(string) + for _, client := range clients { c := client.(map[string]interface{}) @@ -122,6 +129,9 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) { if c["flow"] == "xtls-rprx-vision-udp443" { c["flow"] = "xtls-rprx-vision" } + if network != "tcp" || !(security == "tls" || security == "reality") { + c["flow"] = "" + } } final_clients = append(final_clients, interface{}(c)) }