{"record":{"id":"dc2a8c1710bcbe0f","repo":"MHSanaei/3x-ui","slug":"not-vless","errorCode":null,"errorMessage":"not vless","messagePattern":"not vless","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/util/link/outbound.go","lineNumber":258,"sourceCode":"\tfor k, v := range j {\n\t\tif k == \"ps\" {\n\t\t\tcontinue\n\t\t}\n\t\tcore[k] = v\n\t}\n\tb, _ := json.Marshal(core)\n\treturn \"vmess:\" + string(b)\n}\n\n// --- vless / trojan (URL forms) ---\n\nfunc parseVless(link string) (*ParseResult, error) {\n\tu, err := url.Parse(link)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif u.Scheme != \"vless\" {\n\t\treturn nil, fmt.Errorf(\"not vless\")\n\t}\n\tid := u.User.Username()\n\thost := u.Hostname()\n\tport := defaultPort(u.Port(), 443)\n\tparams := u.Query()\n\tnetwork := params.Get(\"type\")\n\tif network == \"\" {\n\t\tnetwork = \"tcp\"\n\t}\n\tsecurity := params.Get(\"security\")\n\tif security == \"\" {\n\t\tsecurity = \"none\"\n\t}\n\tstream := buildStream(network, security)\n\tapplyTransport(stream, params)\n\tapplySecurity(stream, params)\n\tapplyFinalMask(stream, params)\n","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/MHSanaei/3x-ui/blob/ad32144c42455696ea9f14e12168beac3e25f5d2/internal/util/link/outbound.go#L240-L276","documentation":"Returned by parseVless when the parsed URL's scheme is not exactly 'vless'. In the normal dispatcher flow this is unreachable — ParseOutbound only routes vless://-prefixed links here — so seeing it means parseVless was called directly, or a custom scheme mapping (e.g. vless2://) was routed in manually. It is a cheap invariant guard after url.Parse.","triggerScenarios":"Calling parseVless directly on arbitrary strings; a dispatcher/prefix table extended to route near-miss schemes (vlsss://, VLESS:// on a case-sensitive path); url.Parse normalizing an unusual scheme form.","commonSituations":"Forks that add new link formats but route them to parseVless; tests calling the inner parser directly with fixtures; links where the scheme was uppercased by a forwarding tool.","solutions":["Route only exact 'vless://' prefixed links to parseVless — or call ParseOutbound, which dispatches correctly.","Normalize scheme case before dispatch (strings.ToLower on the prefix).","If a new vless-like scheme exists, give it its own parser or a translation step before calling parseVless."],"exampleFix":"// before\ncase strings.HasPrefix(link, \"vl\"):\n    return parseVless(link)\n\n// after\ncase strings.HasPrefix(strings.ToLower(link), \"vless://\"):\n    return parseVless(link)","handlingStrategy":"validation","validationCode":"func isVlessLink(link string) bool {\n    u, err := url.Parse(strings.TrimSpace(link))\n    return err == nil && strings.EqualFold(u.Scheme, \"vless\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call the public ParseOutbound dispatcher instead of inner parsers.","Dispatch on exact 'vless://' prefixes, case-normalized.","Keep the scheme guard as an invariant even when unreachable via the dispatcher."],"tags":["parsing","proxy-links","vless","invariant"],"backgroundTag":null,"analyzedSha":"ad32144c42455696ea9f14e12168beac3e25f5d2","analyzedAt":"2026-08-15T11:13:23.905Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}