Commit Graph
246 Commits
Author SHA1 Message Date
Hudson CavazinandGitHub ccf1b61e20 httpp: propagate Flush() through the response writer wrappers (#6126)
handlerLogger's responseRecorder and handlerWriteTimeout's writeTimeoutWriter
both wrap http.ResponseWriter but implement neither http.Flusher nor Unwrap().
Any handler that flushes mid-response has that flush silently dropped, and its
output only reaches the client when the handler returns.

That defeats the stated purpose of writeTimeoutWriter, whose own comment says it
exists so one can "write long responses, splitted in chunks, without causing
timeouts": the deadline is reset per Write(), but nothing ever leaves the buffer
until the end.

Found while adding a server-sent-events endpoint: events written and flushed at
t=0.4s only reached the client at t=2.2s, when the handler returned.

Adding Flush() plus Unwrap() (so http.ResponseController can reach through) fixes
both. The new test drives a real listener through both wrappers and reads while
the handler is still blocked, so it fails on the current code by hitting the read
deadline.
2026-08-24 14:40:43 +00:00
55d319abfc webrtc: Register RTX for incoming video tracks (#6125)
webrtc.ConfigureNack() only wires up the NACK RTCP interceptor. pion
still needs an explicit RTX codec registered per media codec before it
can answer a publisher's retransmission offer with one, so
incomingVideoCodecs having none means NACK-triggered retransmission
can never actually happen for incoming video, no matter what the
publisher offers.

Fixes #5678

---------

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-08-24 14:40:20 +00:00
3e09466c18 bump golangci-lint to 2.13.1 (#6129)
* bump golangci-lint to 2.13.1

* additional changes

---------

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-08-22 16:57:28 +00:00
Alessandro RosandGitHub 883194a19b bump dependencies (#6113) 2026-08-18 11:53:43 +00:00
Alessandro RosandGitHub 31a054b79d moq: impose maximum size on pending reordered bytes (#6112)
Decrease the maximum memory that clients can take by imposing a maximum
size of 100MB on the pending reordered bytes.
2026-08-18 12:49:38 +02:00
Alessandro RosandGitHub a56c635f8e fix deadlock when changing configuration through file and API (#6077) (#6101)
When changing configuration in parallel by editing the configuration
file and calling the API, the server could get into a deadlock that
prevented any further action. This is fixed.
2026-08-17 11:14:01 +00:00
Alessandro RosandGitHub 831ed9564b webrtc: support forwarding streams (#6099) 2026-08-16 21:09:59 +02:00
Alessandro RosandGitHub c9f003f247 restore ability to run the server in a read-only file system (#6098)
This was temporarily lost after the introduction of the native MoQ QUIC
listener.
2026-08-16 16:03:37 +02:00
Alessandro RosandGitHub f29816fe50 moq: do not accept empty payloads (#6085) 2026-08-15 16:56:35 +00:00
Alessandro RosandGitHub 145381e81d rtmp: inform about authentication failures (#5657) (#6072)
Reply with NetStream.Play.Failed or NetStream.Publish.Unauthorized when
a client is not authorized to play or publish. This makes clients like
OBS to stop recreating the connection in case of authentication
failures.
2026-08-13 09:05:39 +00:00
Alessandro RosandGitHub a146e55978 webrtc: improve performance by ignoring mDNS candidates (#4963) (#6064)
mDNS candidates sometimes require a large CPU portion, they are not
involved in any connectivity method mentioned in the documentation, they work in
local networks only.
2026-08-10 12:00:23 +00:00
Alessandro RosandGitHub 6f0faa49d1 webrtc: fix warning when IPv6 is disabled (#5733) (#6048) 2026-08-07 10:05:05 +02:00
Alessandro RosandGitHub 1b943637a4 moq: support draft-16 (#6045) 2026-08-05 12:16:07 +02:00
Alessandro RosandGitHub f0d2f11525 moq: link primitives to draft-17 sections (#6044) 2026-08-05 09:33:39 +00:00
Alessandro RosandGitHub c48b0b8fee moq: increase max namespace field count to 32 (#6043) 2026-08-05 09:20:59 +00:00
Alessandro RosandGitHub a4ad182e4e format imports (#6041) 2026-08-04 22:13:15 +00:00
Alessandro RosandGitHub a65bdc1c5a moq: support draft-17 (#6040) 2026-08-04 23:57:27 +02:00
Alessandro RosandGitHub e0ed9885fc moq: support publishing and reading through native QUIC (#6039) 2026-08-04 23:47:59 +02:00
98ab3009ea support forwarding streams natively (#5558)
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>
2026-08-04 21:57:15 +02:00
Alessandro RosandGitHub f36c41d90a webrtc: fix "packet lost" error when routing streams from WebRTC (#6034)
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.
2026-08-04 21:00:11 +02:00
Alessandro RosandGitHub 35990a38c3 webrtc: fix race condition in tests (#6025) 2026-08-03 18:11:24 +02:00
Alessandro RosandGitHub 4bb896afe0 webrtc: reset recomputed audio PTS if it drifts too much (#6021) 2026-08-01 16:24:53 +00:00
Alessandro RosandGitHub ef93aee083 use black-box testing where possible (#6016) 2026-08-01 08:06:27 +00:00
d843a0bf21 webrtc: fix packet corruption when reading G722 (#6000)
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-07-29 13:31:02 +02:00
Alessandro RosandGitHub a0482f937f webrtc: sort tracks in a deterministic way (#5988) (#5989)
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.
2026-07-25 19:44:45 +02:00
Alessandro RosandGitHub 4c5f558006 hls, webrtc: prevent cross-origin unauthorized access (#5975)
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.
2026-07-23 23:06:15 +02:00
Alessandro RosandGitHub 5d0ba43667 moq: prevent excessive CPU consumption in reorderer (#5976)
do not iterate by maxGroupID (passed by user) but iterate by internal
pending packets (uncontrolled by user).
2026-07-23 23:01:05 +02:00
Alessandro RosandGitHub 2183d37d32 add comment to prevent security scan false positives (#5973) 2026-07-23 22:59:23 +02:00
Alessandro RosandGitHub 6da35dc389 moq: support draft-19 of the specification (#5968)
* support draft-19 of the specification

* support subscribing the same track multiple times
2026-07-21 00:24:03 +02:00
Alessandro RosandGitHub 363ac206f7 moq: fix several panics and OOM errors (#5964)
Check for limits before allocating memory by using sizes passed from
the remote peer. Also add fuzzing to all MoQ primitives.
2026-07-19 12:13:45 +02:00
Alessandro RosandGitHub 0e6426c648 adjust code to prevent security scan false positives (#5963)
... about string escaping.
2026-07-19 10:20:37 +02:00
suMinandGitHub 8fcbd0a796 webrtc: skip unresolvable webrtcAdditionalHosts entries instead of aborting (#5845)
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>
2026-06-22 21:14:04 +02:00
Alessandro RosandGitHub 90b8d5c943 improve HTTP server performance (#5886)
log incoming requests without cloning.
2026-06-20 12:03:35 +02:00
Alessandro RosandGitHub 28d648da37 move Content-Types to log in a map (#5875) 2026-06-20 09:35:55 +02:00
varun-nominalandGitHub 472e86d48c redact sensitive headers in HTTP debug logs (#5873) 2026-06-20 09:19:01 +02:00
Alessandro RosandGitHub d0cf294637 print body of selected HTTP responses when log level is debug (#5859) 2026-06-11 00:53:52 +02:00
Alessandro RosandGitHub 959f58cee9 limit size of HTTP requests shown in debug logs (#5858) 2026-06-11 00:31:10 +02:00
Alessandro RosandGitHub 7e576d077f rtsp: use ServerStream.ReloadDesc to propagate description changes to RTSP servers (#5856) 2026-06-10 23:46:02 +02:00
b2dc62e13c rtmp, rtsp: support PROXY protocol (#5754)
Support PROXY protocol v1/v2 on RTMP, RTMPS, RTSP, and RTSPS TCP
listeners so real client IPs are visible when running behind L4 proxies
(nginx stream, HAProxy, AWS NLB).

---------

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-06-05 21:37:53 +02:00
Alessandro RosandGitHub b5b63d02fc support reading and publishing with Media-over-QUIC (#5815)
Media-over-QUIC is a streaming protocol built upon cutting edge
protocols (QUIC, HTTP3) and browser APIs (WebTransport, WebCodecs).
It's slightly faster than WebRTC, has an advanced data recovery
mechanism (placed at the frame level and not at the packet level), it
supports additional codecs (FLAC) and is less complicated to route.
2026-06-02 23:04:24 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>aler9
c11810c2fc build(deps): bump github.com/bluenviron/gortsplib/v5 from 5.5.3 to 5.5.4 (#5822)
* build(deps): bump github.com/bluenviron/gortsplib/v5 from 5.5.3 to 5.5.4

Bumps [github.com/bluenviron/gortsplib/v5](https://github.com/bluenviron/gortsplib) from 5.5.3 to 5.5.4.
- [Commits](https://github.com/bluenviron/gortsplib/compare/v5.5.3...v5.5.4)

---
updated-dependencies:
- dependency-name: github.com/bluenviron/gortsplib/v5
  dependency-version: 5.5.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* additional changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-06-02 21:50:15 +02:00
Alessandro RosandGitHub 640ddde51b webrtc: fix connectivity after network changes (#5097) (#5818) 2026-06-02 21:40:00 +02:00
Alessandro RosandGitHub 7ab03cdc58 webrtc: rename incoming/outgoing into inbound/outbound (#5816) 2026-06-02 09:15:49 +02:00
Alessandro RosandGitHub 0f5a76e253 modernize code (#5814) 2026-05-31 20:33:48 +02:00
Alessandro RosandGitHub 2795962d8e hls: support reading and publishing FLAC (#5778) (#5791) 2026-05-21 17:00:59 +02:00
Alessandro RosandGitHub 0edc3dbe86 rtmp: support reading and writing FLAC (#5778) (#5789) 2026-05-21 14:50:06 +02:00
Alessandro RosandGitHub c05c14d9af webrtc: support WHIP ICE restarts (#5183) (#5770) 2026-05-15 19:15:42 +02:00
Alessandro RosandGitHub cdea2dc167 webrtc: support interacting with servers with no trickle ICE (#5273) (#5757) 2026-05-12 21:07:16 +02:00
Alessandro RosandGitHub f542ccaf19 webrtc: fix checking POST responses (#5758) 2026-05-12 19:06:08 +02:00
ehandGitHub fcf5eb092d hls: support reading and writing KLV (#5604) 2026-04-30 12:14:00 +02:00