kmp_rtmp_out_notif_add_header
Configures the addition of custom headers for RTMP output notifications in Kaltura Media Framework.
Description
The kmp_rtmp_out_notif_add_header directive is designed to enhance the RTMP (Real-Time Messaging Protocol) output functionality by allowing users to add custom headers to the notifications sent out during streaming sessions. It takes two arguments: the first is the name of the header to be added, and the second is the corresponding value. This feature is especially useful for injecting additional metadata or managing client behaviors, such as authorization tokens or specific instructions that might dictate how receiving systems should process or interpret the stream.
When this directive is specified in the stream or stream server context, NGINX captures the headers defined and incorporates them into the notification messages sent to connected clients. This operation is crucial in scenarios where dynamic content delivery is involved, as it allows the upstream services or clients to respond dynamically based on the headers received. For efficient usage, ensure that the headers do not conflict with standard RTMP protocol headers and that they are logically structured to facilitate parsing on the client's end.
Misconfiguration may lead to empty headers or refused connections, particularly if security-sensitive values are involved. Therefore, testing and validation in a controlled environment before deploying to production is always recommended.
Config Example
stream {
server {
listen 1935;
kmp_rtmp_out_notif_add_header X-Custom-Header "SomeValue";
}
}Ensure that the header name is compatible with RTMP specifications to avoid potential issues.
Double-check that you are within the correct context (stream or stream server) when using this directive.
Be aware of header size limits imposed by the RTMP protocol. Oversized headers may get truncated.