XTLS/Xray-core · error

failed to find an available destination

Error message

failed to find an available destination

What it means

Error "failed to find an available destination" thrown in XTLS/Xray-core.

Source

Thrown at proxy/socks/client.go:75

	// Destination of the inner request.
	destination := ob.Target

	// Outbound server.
	server := c.server
	dest := server.Destination
	// Connection to the outbound server.
	var conn stat.Connection

	if err := retry.ExponentialBackoff(5, 100).On(func() error {
		rawConn, err := dialer.Dial(ctx, dest)
		if err != nil {
			return err
		}
		conn = rawConn

		return nil
	}); err != nil {
		return errors.New("failed to find an available destination").Base(err)
	}

	defer func() {
		if err := conn.Close(); err != nil {
			errors.LogInfoInner(ctx, err, "failed to closed connection")
		}
	}()

	p := c.policyManager.ForLevel(0)

	request := &protocol.RequestHeader{
		Version: socks5Version,
		Command: protocol.RequestCommandTCP,
		Address: destination.Address,
		Port:    destination.Port,
	}

	if destination.Network == net.Network_UDP {

View on GitHub (pinned to 7d214f8b09)

When it happens

Trigger: Thrown at proxy/socks/client.go:75 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/234b754ed92e57bd. Report an issue: GitHub.