XTLS/Xray-core · error

missing psk

Error message

missing psk

What it means

Error "missing psk" thrown in XTLS/Xray-core.

Source

Thrown at proxy/shadowsocks_2022/outbound.go:47

type Outbound struct {
	ctx    context.Context
	server net.Destination
	method shadowsocks.Method
}

func NewClient(ctx context.Context, config *ClientConfig) (*Outbound, error) {
	o := &Outbound{
		ctx: ctx,
		server: net.Destination{
			Address: config.Address.AsAddress(),
			Port:    net.Port(config.Port),
			Network: net.Network_TCP,
		},
	}
	if C.Contains(shadowaead_2022.List, config.Method) {
		if config.Key == "" {
			return nil, errors.New("missing psk")
		}
		method, err := shadowaead_2022.NewWithPassword(config.Method, config.Key, nil)
		if err != nil {
			return nil, errors.New("create method").Base(err)
		}
		o.method = method
	} else {
		return nil, errors.New("unknown method ", config.Method)
	}
	return o, nil
}

func (o *Outbound) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
	var inboundConn net.Conn
	inbound := session.InboundFromContext(ctx)
	if inbound != nil {
		inboundConn = inbound.Conn
	}

View on GitHub (pinned to 7d214f8b09)

When it happens

Trigger: Thrown at proxy/shadowsocks_2022/outbound.go:47 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/d2902178a3ac03fb. Report an issue: GitHub.