MHSanaei/3x-ui · warning

not vless

Error message

not vless

What it means

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.

Source

Thrown at internal/util/link/outbound.go:258

	for k, v := range j {
		if k == "ps" {
			continue
		}
		core[k] = v
	}
	b, _ := json.Marshal(core)
	return "vmess:" + string(b)
}

// --- vless / trojan (URL forms) ---

func parseVless(link string) (*ParseResult, error) {
	u, err := url.Parse(link)
	if err != nil {
		return nil, err
	}
	if u.Scheme != "vless" {
		return nil, fmt.Errorf("not vless")
	}
	id := u.User.Username()
	host := u.Hostname()
	port := defaultPort(u.Port(), 443)
	params := u.Query()
	network := params.Get("type")
	if network == "" {
		network = "tcp"
	}
	security := params.Get("security")
	if security == "" {
		security = "none"
	}
	stream := buildStream(network, security)
	applyTransport(stream, params)
	applySecurity(stream, params)
	applyFinalMask(stream, params)

View on GitHub (pinned to ad32144c42)

Solutions

  1. Route only exact 'vless://' prefixed links to parseVless — or call ParseOutbound, which dispatches correctly.
  2. Normalize scheme case before dispatch (strings.ToLower on the prefix).
  3. If a new vless-like scheme exists, give it its own parser or a translation step before calling parseVless.

Example fix

// before
case strings.HasPrefix(link, "vl"):
    return parseVless(link)

// after
case strings.HasPrefix(strings.ToLower(link), "vless://"):
    return parseVless(link)
Defensive patterns

Strategy: validation

Validate before calling

func isVlessLink(link string) bool {
    u, err := url.Parse(strings.TrimSpace(link))
    return err == nil && strings.EqualFold(u.Scheme, "vless")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of MHSanaei/3x-ui@ad32144c42 (2026-08-15). Data as JSON: /api/errors/dc2a8c1710bcbe0f. Report an issue: GitHub.