XTLS/Xray-core · error

failed to process loopback connection

Error message

failed to process loopback connection

What it means

Loopback outbound Process fails redispatching the connection into the configured inbound via DispatchLink; the chained error is the dispatcher's rejection (unknown inbound tag or dispatch failure) and includes the context for logging.

Solutions

  1. Verify the loopback inboundTag exists
  2. Inspect the wrapped dispatch error
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/loopback/loopback.go:48 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/9b69aaae02e10246. Report an issue: GitHub.

Appendix: source

Thrown at proxy/loopback/loopback.go:48

	errors.LogInfo(ctx, "opening connection to ", destination)
	content := new(session.Content)
	content.SkipDNSResolve = true
	content.SniffingRequest = l.sniffingRequest

	ctx = session.ContextWithContent(ctx, content)
	inbound := &session.Inbound{}
	originInbound := session.InboundFromContext(ctx)
	if originInbound != nil {
		// get a shallow copy to avoid modifying the inbound tag in upstream context
		*inbound = *originInbound
	}
	inbound.Tag = l.inboundTag
	ctx = session.ContextWithInbound(ctx, inbound)

	err := l.dispatcherInstance.DispatchLink(ctx, destination, link)
	if err != nil {
		return errors.New(ctx, "failed to process loopback connection").Base(err)
	}
	return nil
}

func (l *Loopback) init(config *Config, dispatcherInstance routing.Dispatcher) error {
	l.dispatcherInstance = dispatcherInstance
	l.inboundTag = config.InboundTag
	if config.Sniffing.GetEnabled() {
		request, err := proxyman.BuildSniffingRequest(config.Sniffing)
		if err != nil {
			return errors.New("failed to build loopback sniffing request").Base(err).AtError()
		}
		l.sniffingRequest = request
	}
	return nil
}

func init() {

View on GitHub (pinned to 7d214f8b09)