Always proxy WHIP ingresses that bypass transcoding - #471
Merged
Conversation
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>
paulwe
approved these changes
Aug 26, 2026
cnderrauber
approved these changes
Aug 26, 2026
milos-lk
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHIP requests with transcoding disabled were handled one of two ways depending on the
whip_proxy_enabledconfig: in-process by the nativewhipHandler, 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
SDKMediaSinkandSDKWhipTrackHandler, and therunSession/addTrackbranches that drove them.whipHandlerIngressHandlerRPC implementations. It only registered them whencreateStreamhanded it a bus, which happened solely in the bypass branch — bypass sessions are now served byproxyWhipHandlerand transcoded ones by the handler process, sowhipHandlerno longer registers RPCs at all and can no longer fail to construct.whip_proxy_enabledconfig field and thegetWhipProxyEnabledcallback toWHIPServer.Start.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.trackHandlersis keyed bytypes.StreamKinddirectly andRelayWhipTrackHandlerloses itsqualityfield.This changes the video media stats path from
input.video.HIGHtoinput.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.ReplaceRTCPPacketSSRCand its test, and thelksdk_outputPacketSinkplumbing,LocalTrack.WriteRTPandLKSDKOutput.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 theWHIPHandlerinterface were never invoked through it — the server reaches them over psrpc vias.rpcClient. Config parsing is non-strictyaml.Unmarshal, so deployments still carryingwhip_proxy_enabledload fine with the key ignored.go build ./...,go vet -tags integration ./...andgo test ./pkg/...pass.