It is now possible to define forward destinations for each path configuration. For each destination, the server will create a client that will forward the stream to the intended destination. Supported protocols are RTSP, RTMP, SRT. API and metrics have also been improved to allow monitoring the new forwarding system.
---------
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
Chrome sometimes sends empty packets, that are discarded by the server,
but the sequence number of following packets is not recomputed,
leading downstream packet loss detectors to emit errors. This is fixed.
When ingesting tracks with WebRTC, track order was randomized,
preventing multi-track always-available streams from working reliably,
since they require tracks to be ordered in a precise way.
WebRTC tracks are not ordered by MID, RID, trackID and streamID
respectively.
when a user had previously inserted credentials into a MediaMTX
instance through a browser, and AllowOrigins was set to a wildcard,
third-party websites visited by the user were allowed to read streams
without restrictions. This is now prevented by returning "*" in
Access-Control-Allow-Origins when AllowOrigins is a wildcard, a
behavior that prevents browsers from sharing credentials with
third-party websites.
When clients connect with some protocols (SRT, RTMP), they are unable
to provide credentials even if they are asked to. In this case, it's
useless to wait for credentials, and it's better to immediately log
authentication errors and apply the anti-brute force algorithm.
The == operator is vulnerable to timing attacks as it short-circuits on a mismatch. Use
ConstantTimeCompare to avoid this vector.
Co-authored-by: Tristan Matthews <tmatth@videolan.org>
MTX_AUTHINTERNALUSERS_0_IPS, MTX_LOGDESTINATIONS and MTX_RTSPTRANSPORTS
can now be used to clear their corresponding list by setting them to an
empty value.
Since #4866, hostnames in webrtcAdditionalHosts are resolved server-side via
net.LookupIP, and a resolution failure aborts the entire WHEP/WHIP session.
A single entry that can't be resolved on the server (e.g. air-gapped networks
without DNS, or a name that only resolves on the client) therefore takes down
all WebRTC playback, even when the other entries are valid.
Log a warning and skip the unresolvable entry instead of returning an error,
so the remaining valid candidates are still offered.
Signed-off-by: suMin <sumin77123@gmail.com>
timeLocationDecode multiplied the minutes field of a %z token by 3600
instead of 60, and did not apply the sign to the minutes term. As a
result, any non-whole-hour timezone offset (e.g. +0530, +0545, +0330,
-0330) was decoded incorrectly: +0530 produced 126000s instead of
19800s.
This broke the round-trip between Path.Encode and Path.Decode for
fractional-hour timezones. The encode side already used off/60/60 and
(off/60)%60 correctly, so this change makes the two consistent.
Add round-trip test cases with fractional-hour offsets (+0530, +0545,
-0330) to cover the previously untested code path.