XTLS/Xray-core · error

failed to build stream settings for outbound detour

Error message

failed to build stream settings for outbound detour

What it means

Outbound detour Build delegates to StreamSetting.Build() and it failed (bad security, TLS, REALITY or transport settings); the chained error identifies the failing stream field while this wrapper names the outbound context.

Solutions

  1. Fix streamSettings per the Base error
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at infra/conf/xray.go:320 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at infra/conf/xray.go:320

		address := ParseSendThough(c.SendThrough)
		// Check if CIDR exists
		if strings.Contains(*c.SendThrough, "/") {
			senderSettings.ViaCidr = strings.Split(*c.SendThrough, "/")[1]
		} else {
			if address.Family().IsDomain() {
				domain := address.Address.Domain()
				if domain != "origin" && domain != "srcip" {
					return nil, errors.New("unable to send through: " + address.String())
				}
			}
		}
		senderSettings.Via = address.Build()
	}

	if c.StreamSetting != nil {
		ss, err := c.StreamSetting.Build()
		if err != nil {
			return nil, errors.New("failed to build stream settings for outbound detour").Base(err)
		}
		senderSettings.StreamSettings = ss
	}

	if c.ProxySettings != nil {
		ps, err := c.ProxySettings.Build()
		if err != nil {
			return nil, errors.New("invalid outbound detour proxy settings").Base(err)
		}
		if ps.TransportLayerProxy {
			if senderSettings.StreamSettings != nil {
				if senderSettings.StreamSettings.SocketSettings != nil {
					senderSettings.StreamSettings.SocketSettings.DialerProxy = ps.Tag
				} else {
					senderSettings.StreamSettings.SocketSettings = &internet.SocketConfig{DialerProxy: ps.Tag}
				}
			} else {
				senderSettings.StreamSettings = &internet.StreamConfig{SocketSettings: &internet.SocketConfig{DialerProxy: ps.Tag}}

View on GitHub (pinned to 7d214f8b09)