AlexxIT/go2rtc · error
unsupported url:
Error message
unsupported url:
What it means
The WebRTC client factory (streamsHandler) tried every known WHEP/ signaling pattern against the URL — go2rtc WS, creality, plain WHEP heuristics — and none matched the URL's shape/scheme, so it gives up with this error.
Solutions
- Use a supported URL form: go2rtc ws://host:1984/api/ws?src=name or a standard WHEP endpoint (e.g. https://host/whep)
- Check the URL scheme/path matches what your camera vendor actually exposes; many WebRTC cameras are not WHEP-compatible
- Add a custom producer for the vendor's signaling protocol if it's proprietary
- Enable debug logs to see which client branch was attempted before failing
Example fix
// before src: "http://camera.local/webrtc" // after src: "https://camera.local/whep"
Defensive patterns
Strategy: validation
Validate before calling
func isWebRTCSource(u string) bool {
parsed, err := url.Parse(u)
if err != nil {
return false
}
switch parsed.Scheme {
case "ws", "wss", "http", "https":
return true
}
return false
} Try / catch
prod, err := streamsHandler(rawURL)
if err != nil && strings.HasPrefix(err.Error(), "unsupported url:") {
// fall back to another consumer (HLS/MSE) or report config error
} Prevention
- Use go2rtc WS or standard WHEP endpoints for webrtc sources
- Test camera signaling URLs with a WHEP client before adding to config
- Document vendor-specific requirements in stream config comments
When it happens
Trigger: Passing a WebRTC source URL to a stream that is neither a go2rtc ws:// signaling URL, a recognized creality URL, nor a WHEP-style URL; e.g. empty string, http:// page, or an unsupported signaling scheme like plain WHIP or custom vendor URLs.
Common situations: Typo in the camera signaling URL; pointing at a WHIP (publish) endpoint instead of WHEP (play); vendor cameras with proprietary signaling not integrated in go2rtc.
Understand the failure class
Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.
Related errors
AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07).
Data as JSON: /api/errors/48d6987eca5f01f6.
Report an issue: GitHub.
Appendix: source
Thrown at internal/webrtc/client.go:66
return switchbotClient(rawURL, query)
} else {
return go2rtcClient(rawURL)
}
case "http", "https":
if format == "milestone" {
return milestoneClient(rawURL, query)
} else if format == "wyze" {
// https://github.com/mrlt8/docker-wyze-bridge
return wyzeClient(rawURL)
} else if format == "creality" {
return crealityClient(rawURL)
} else {
return whepClient(rawURL)
}
}
}
return nil, errors.New("unsupported url: " + rawURL)
}
// go2rtcClient can connect only to go2rtc server
// ex: ws://localhost:1984/api/ws?src=camera1
func go2rtcClient(url string) (core.Producer, error) {
// 1. Connect to signalign server
conn, _, err := Dial(url)
if err != nil {
return nil, err
}
// close websocket when we ready return Producer or connection error
defer conn.Close()
// 2. Create PeerConnection
pc, err := PeerConnection(true)
if err != nil {
return nil, errView on GitHub (pinned to c245815e75)