Skip to content

Always proxy WHIP ingresses that bypass transcoding - #471

Merged
biglittlebigben merged 1 commit into
mainfrom
benjamin/remove_non_proxy_whip
Aug 27, 2026
Merged

Always proxy WHIP ingresses that bypass transcoding#471
biglittlebigben merged 1 commit into
mainfrom
benjamin/remove_non_proxy_whip

Conversation

@biglittlebigben

Copy link
Copy Markdown
Contributor

WHIP requests with transcoding disabled were handled one of two ways depending on the whip_proxy_enabled config: in-process by the native whipHandler, publishing to the room over the LiveKit SDK, or forwarded to the SFU by the proxy handler. This drops the in-process variant and always proxies, so the native handler is now used only when transcoding.

Removed

  • SDKMediaSink and SDKWhipTrackHandler, and the runSession / addTrack branches that drove them.
  • The whipHandler IngressHandler RPC implementations. It only registered them when createStream handed it a bus, which happened solely in the bypass branch — bypass sessions are now served by proxyWhipHandler and transcoded ones by the handler process, so whipHandler no longer registers RPCs at all and can no longer fail to construct.
  • The whip_proxy_enabled config field and the getWhipProxyEnabled callback to WHIPServer.Start.
  • The interceptor and simulcast branches that only applied without transcoding.

Quality plumbing

With the native handler restricted to transcoding, it rejects any offer carrying simulcast layers, so a track's quality could only ever be HIGH. trackHandlers is keyed by types.StreamKind directly and RelayWhipTrackHandler loses its quality field.

This changes the video media stats path from input.video.HIGH to input.video, matching what the RTMP server and the media pipeline already register. Worth a look from anyone with dashboards or alerts keyed on the old path.

Orphaned by the above

replaceICEDetails, utils.ReplaceRTCPPacketSSRC and its test, and the lksdk_output PacketSink plumbing, LocalTrack.WriteRTP and LKSDKOutput.WriteRTCP.

Verification

Every removed symbol was traced to its callers on main; each one's only callers were inside the deleted bypass path. The four RPC methods dropped from the WHIPHandler interface were never invoked through it — the server reaches them over psrpc via s.rpcClient. Config parsing is non-strict yaml.Unmarshal, so deployments still carrying whip_proxy_enabled load fine with the key ignored.

go build ./..., go vet -tags integration ./... and go test ./pkg/... pass.

WHIP requests with transcoding disabled were either handled in-process by
the native whipHandler, publishing to the room over the LiveKit SDK, or
forwarded to the SFU by the proxy handler, depending on the
whip_proxy_enabled config. Drop the in-process variant and always proxy, so
the native handler is now used only when transcoding.

Removes SDKMediaSink and SDKWhipTrackHandler, the whipHandler
IngressHandler RPC implementations (bypass sessions are now served by
proxyWhipHandler, transcoded ones by the handler process, so whipHandler no
longer registers RPCs at all), the interceptor and simulcast branches that
only applied without transcoding, and the whip_proxy_enabled config field
along with the getWhipProxyEnabled callback to WHIPServer.Start.

With the native handler restricted to transcoding it rejects any offer
carrying simulcast layers, so a track's quality could only ever be HIGH:
trackHandlers is keyed by types.StreamKind directly and RelayWhipTrackHandler
loses its quality field. This changes the video media stats path from
"input.video.HIGH" to "input.video", matching what the RTMP server and the
media pipeline already register.

Also drops what the removal orphaned: replaceICEDetails,
utils.ReplaceRTCPPacketSSRC, and the lksdk_output PacketSink plumbing,
LocalTrack.WriteRTP and LKSDKOutput.WriteRTCP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@biglittlebigben
biglittlebigben marked this pull request as ready for review August 26, 2026 00:40
@biglittlebigben
biglittlebigben requested a review from a team as a code owner August 26, 2026 00:40

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@biglittlebigben
biglittlebigben merged commit c158be2 into main Aug 27, 2026
12 checks passed
@biglittlebigben
biglittlebigben deleted the benjamin/remove_non_proxy_whip branch August 27, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants