{"record":{"id":"166fe00833463df8","repo":"AlexxIT/go2rtc","slug":"streams-unsupported-scheme","errorCode":null,"errorMessage":"streams: unsupported scheme: ","messagePattern":"streams: unsupported scheme: ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/streams/handlers.go","lineNumber":69,"sourceCode":"\tif i := strings.IndexByte(url, ':'); i > 0 {\n\t\tscheme := url[:i]\n\n\t\tif redirect, ok := redirects[scheme]; ok {\n\t\t\tlocation, err := redirect(url)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif location != \"\" {\n\t\t\t\treturn GetProducer(location)\n\t\t\t}\n\t\t}\n\n\t\tif handler, ok := handlers[scheme]; ok {\n\t\t\treturn handler(url)\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"streams: unsupported scheme: \" + url)\n}\n\n// Redirect can return: location URL or error or empty URL and error\ntype Redirect func(url string) (string, error)\n\nvar redirects = map[string]Redirect{}\n\nfunc RedirectFunc(scheme string, redirect Redirect) {\n\tredirects[scheme] = redirect\n}\n\nfunc Location(url string) (string, error) {\n\tif i := strings.IndexByte(url, ':'); i > 0 {\n\t\tscheme := url[:i]\n\n\t\tif redirect, ok := redirects[scheme]; ok {\n\t\t\treturn redirect(url)\n\t\t}","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/streams/handlers.go#L51-L87","documentation":"GetProducer returns this when the URL's scheme (the part before the first ':') has no registered handler and no registered redirect in the handlers maps. The full unsupported URL is appended. It means the source protocol is unknown to the process at runtime, e.g. an unsupported or unimported producer scheme.","triggerScenarios":"Thrown at internal/streams/handlers.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the URL scheme for typos (e.g. 'rstp' instead of 'rtsp')","Verify the module providing a producer for that scheme was compiled in and registered its HandleFunc","Add a handler for the scheme or redirect it to a supported one via RedirectFunc"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}