egress icon indicating copy to clipboard operation
egress copied to clipboard

TrackEgress WebSocket custom headers

Open janoskranczler opened this issue 2 years ago • 1 comments

It would be nice for the user to add custom headers to the WebSocket stream. For example for authorization. In the Egress code currently, only the Content-Type header was added: https://github.com/livekit/egress/blob/f1ce2fbf55338904ee7fc2937eeb600dd482ed3d/pkg/pipeline/sink/websocket.go#L31

My proposal The user could add extra headers in startTrackEgress request body in an optional headers parameter:

{
    "room_name": "my-room",
    "track_id": "TR_XXXXXXXXXXXX",
    "websocket_url": "wss://my-websocket-server.com",
    "headers": {
        "Authorization": "Bearer XXXXXXXXXXXXXXX"
    }
}

janoskranczler avatar Feb 22 '23 15:02 janoskranczler

@janoskranczler Custom headers is a really good idea for this feature. Thanks for bringing this up.

davidzhao avatar Feb 24 '23 00:02 davidzhao