{"record":{"id":"df8e60f0a72465d9","repo":"XTLS/Xray-core","slug":"invalid-redirect-address","errorCode":null,"errorMessage":"invalid redirect address: {}","messagePattern":"invalid redirect address: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/freedom.go","lineNumber":164,"sourceCode":"\t\treturn nil, errors.PrintRemovedFeatureError(\"noise = { ... }\", \"noises = [ { ... } ]\")\n\t}\n\n\tif c.Noises != nil {\n\t\tfor _, n := range c.Noises {\n\t\t\tNConfig, err := ParseNoise(n)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tconfig.Noises = append(config.Noises, NConfig)\n\t\t}\n\t}\n\n\tconfig.UserLevel = c.UserLevel\n\n\tif len(c.Redirect) > 0 {\n\t\thost, portStr, err := net.SplitHostPort(c.Redirect)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"invalid redirect address: \", c.Redirect, \": \", err).Base(err)\n\t\t}\n\t\tport, err := xnet.PortFromString(portStr)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"invalid redirect port: \", c.Redirect, \": \", err).Base(err)\n\t\t}\n\t\tconfig.DestinationOverride = &freedom.DestinationOverride{\n\t\t\tServer: &protocol.ServerEndpoint{\n\t\t\t\tPort: uint32(port),\n\t\t\t},\n\t\t}\n\n\t\tif len(host) > 0 {\n\t\t\tconfig.DestinationOverride.Server.Address = xnet.NewIPOrDomain(xnet.ParseAddress(host))\n\t\t}\n\t}\n\n\tif c.ProxyProtocol > 0 && c.ProxyProtocol <= 2 {\n\t\tconfig.ProxyProtocol = c.ProxyProtocol","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/freedom.go#L146-L182","documentation":"Thrown while building a freedom outbound whose 'redirect' string cannot be split into host and port by net.SplitHostPort. Redirect must be a dialable address like \"example.com:443\" or \":8443\"; the chained base error carries the exact SplitHostPort failure (missing port, too many colons, etc.).","triggerScenarios":"\"redirect\": \"example.com\" (no port), \"redirect\": \"127.0.0.1:80:443\", or an unbracketed IPv6 \"::1:443\". Any value for which SplitHostPort errors triggers it.","commonSituations":"Forgetting the port; pasting bare domains; IPv6 literals without square brackets; redirect copied from a browser URL with a path appended.","solutions":["Format redirect as \"host:port\", e.g. \"example.com:443\"; a bare \":8080\" redirects port only.","Bracket IPv6: \"[2001:db8::1]:443\".","Check the base error text for the precise reason (missing port vs. too many colons)."],"exampleFix":"// before\n\"redirect\": \"example.com\"\n\n// after\n\"redirect\": \"example.com:443\"","handlingStrategy":"validation","validationCode":"if _, _, err := net.SplitHostPort(redirect); err != nil {\n    return fmt.Errorf(\"redirect %q must be host:port: %w\", redirect, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the port in redirect; bracket IPv6 hosts.","Reuse one validated address formatter for redirect fields."],"tags":["go","xray","freedom","outbound","address","config","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}