{"record":{"id":"d04ee76886f4e67d","repo":"XTLS/Xray-core","slug":"unsupported-method-method","errorCode":null,"errorMessage":"unsupported method ${method}","messagePattern":"unsupported method (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/shadowsocks_2022/inbound.go","lineNumber":55,"sourceCode":"\temail    string\n\tlevel    int\n}\n\nfunc NewServer(ctx context.Context, config *ServerConfig) (*Inbound, error) {\n\tnetworks := config.Network\n\tif len(networks) == 0 {\n\t\tnetworks = []net.Network{\n\t\t\tnet.Network_TCP,\n\t\t\tnet.Network_UDP,\n\t\t}\n\t}\n\tinbound := &Inbound{\n\t\tnetworks: networks,\n\t\temail:    config.Email,\n\t\tlevel:    int(config.Level),\n\t}\n\tif !C.Contains(shadowaead_2022.List, config.Method) {\n\t\treturn nil, errors.New(\"unsupported method \", config.Method)\n\t}\n\tservice, err := shadowaead_2022.NewServiceWithPassword(config.Method, config.Key, 500, inbound, nil)\n\tif err != nil {\n\t\treturn nil, errors.New(\"create service\").Base(err)\n\t}\n\tinbound.service = service\n\treturn inbound, nil\n}\n\nfunc (i *Inbound) Network() []net.Network {\n\treturn i.networks\n}\n\nfunc (i *Inbound) Process(ctx context.Context, network net.Network, connection stat.Connection, dispatcher routing.Dispatcher) error {\n\tinbound := session.InboundFromContext(ctx)\n\tinbound.Name = \"shadowsocks-2022\"\n\tinbound.CanSpliceCopy = 3\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/shadowsocks_2022/inbound.go#L37-L73","documentation":"Config error when creating a shadowsocks-2022 inbound: config.Method is not present in shadowaead_2022.List. Only the 2022 AEAD family is accepted here (2022-blake3-aes-128-gcm, 2022-blake3-aes-256-gcm, 2022-blake3-chacha20-poly1305) — plain AEAD or legacy names valid for the classic shadowsocks inbound are rejected in this handler.","triggerScenarios":"Building a shadowsocks-2022 inbound whose method field is e.g. aes-256-gcm, chacha20-ietf-poly1305, or a typo'd 2022 name; the C.Contains check fails and returns this error before any service construction.","commonSituations":"Copying a classic Shadowsocks inbound and switching protocol to shadowsocks-2022 without changing the method; panel defaulting to aes-256-gcm; confusion between the two shadowsocks protocol handlers.","solutions":["Set method to one of: 2022-blake3-aes-128-gcm, 2022-blake3-aes-256-gcm, or 2022-blake3-chacha20-poly1305.","If you intended classic AEAD, use protocol \"shadowsocks\" instead of \"shadowsocks-2022\".","Validate the config with xray run -test before deploying."],"exampleFix":"// before\n{ \"protocol\": \"shadowsocks-2022\", \"settings\": { \"method\": \"aes-256-gcm\", \"password\": \"...\" } }\n// after\n{ \"protocol\": \"shadowsocks-2022\", \"settings\": { \"method\": \"2022-blake3-aes-256-gcm\", \"password\": \"<base64-32B-key>\" } }","handlingStrategy":"validation","validationCode":"var ss2022Methods = []string{\n  \"2022-blake3-aes-128-gcm\",\n  \"2022-blake3-aes-256-gcm\",\n  \"2022-blake3-chacha20-poly1305\",\n}\nfunc validateSS2022Method(m string) error {\n  for _, s := range ss2022Methods { if s == m { return nil } }\n  return fmt.Errorf(\"unsupported method %q; expected one of %v\", m, ss2022Methods)\n}","typeGuard":"func isSS2022Method(m string) bool {\n  return slices.Contains([]string{\"2022-blake3-aes-128-gcm\", \"2022-blake3-aes-256-gcm\", \"2022-blake3-chacha20-poly1305\"}, m)\n}","tryCatchPattern":null,"preventionTips":["Use the shadowsocks-2022 protocol only with 2022-blake3-* methods.","Keep separate config templates for classic vs 2022 shadowsocks.","Validate with xray run -test."],"tags":["shadowsocks-2022","config","method","validation","cipher"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}