XTLS/Xray-core · error

unsupported mode:

Error message

unsupported mode: 

What it means

SplitHTTPConfig.Build() validates the "mode" field in a switch at transport_method.go:319-325. Empty defaults to "auto"; only "auto", "packet-up", "stream-up", "stream-one" pass. Any other string returns this error with the offending value appended. Note: when "extra" is present, mode comes from the OUTER config (extra.Mode is overwritten at line 315), so the bad value must be fixed at top level.

Source

Thrown at infra/conf/transport_method.go:324

// Build implements Buildable.
func (c *SplitHTTPConfig) Build() (proto.Message, error) {
	if c.Extra != nil {
		var extra SplitHTTPConfig
		if err := json.Unmarshal(c.Extra, &extra); err != nil {
			return nil, errors.New(`Failed to unmarshal "extra".`).Base(err)
		}
		extra.Host = c.Host
		extra.Path = c.Path
		extra.Mode = c.Mode
		c = &extra
	}

	switch c.Mode {
	case "":
		c.Mode = "auto"
	case "auto", "packet-up", "stream-up", "stream-one":
	default:
		return nil, errors.New("unsupported mode: " + c.Mode)
	}

	// Priority (client): host > serverName > address
	for k := range c.Headers {
		if strings.ToLower(k) == "host" {
			return nil, errors.New(`"headers" can't contain "host"`)
		}
	}

	if c.XPaddingBytes != (Int32Range{}) && (c.XPaddingBytes.From <= 0 || c.XPaddingBytes.To <= 0) {
		return nil, errors.New("xPaddingBytes cannot be disabled")
	}

	if c.XPaddingKey == "" {
		c.XPaddingKey = "x_padding"
	}

	if c.XPaddingHeader == "" {

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Set "mode" to one of: "auto" (default), "packet-up", "stream-up", "stream-one"
  2. Omit "mode" entirely to get "auto"
  3. Fix the value at the top level of transportSettings, not inside "extra" — extra's mode is always overwritten
  4. Verify spelling: hyphenated lowercase only, no underscores

Example fix

// before
"mode": "streamup"
// after
"mode": "stream-up"
Defensive patterns

Strategy: type-guard

Type guard

func validSplithttpMode(m string) bool {
	switch m {
	case "", "auto", "packet-up", "stream-up", "stream-one":
		return true
	}
	return false
}

Prevention

When it happens

Trigger: splithttp transportSettings with "mode": "stream-up" variants misspelled ("streamup", "stream_up"), legacy value "half-caddy" from very old XHTTP versions, or arbitrary strings like "tcp". Also mode set only inside "extra" stays empty (allowed) — the error only fires for explicit non-empty invalid values.

Common situations: Configs written for older/newer forks where mode names differ; typos when hand-editing; guides that document a mode this build does not support (check the case list in your version's source).

Related errors


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/28cfc49eaba8aa1f. Report an issue: GitHub.