AlexxIT/go2rtc · error

wrong URL:

Error message

wrong URL: 

What it means

Webtorrent streamHandle's URL-shape guard: the parsed query string's 'share' parameter is shorter than 8 chars or 'pwd' shorter than 4. These are the minimum lengths for a usable webtorrent share ID and password, so the URL is treated as malformed and rejected before any peer connection is made.

Solutions

  1. Fix the webtorrent://...?share=...&pwd=... URL to include full-length share and password values
  2. Copy the share link verbatim from the source that generated it
  3. Validate share/pwd lengths client-side before configuring the source
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/webtorrent/init.go:167 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/6e6a4b96ce48db73. Report an issue: GitHub.

Appendix: source

Thrown at internal/webtorrent/init.go:167

			srv.RemoveShare(share)
			delete(shares, src)
		} else {
			http.Error(w, "", http.StatusNotFound)
		}
	}
}

func streamHandle(rawURL string) (core.Producer, error) {
	u, err := url.Parse(rawURL)
	if err != nil {
		return nil, err
	}

	query := u.Query()
	share := query.Get("share")
	pwd := query.Get("pwd")
	if len(share) < 8 || len(pwd) < 4 {
		return nil, errors.New("wrong URL: " + rawURL)
	}

	pc, err := webrtc.PeerConnection(true)
	if err != nil {
		return nil, err
	}

	return webtorrent.NewClient(srv.URL, share, pwd, pc)
}

View on GitHub (pinned to c245815e75)