winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.75k stars 571 forks source link

[bug] Notification call (on_publish) doesn't change HLS stream name based on the 302 redirect #151

Closed ham3r closed 4 years ago

ham3r commented 4 years ago

Expected behavior

When RTMP stream is pushed do the application, it should generate HLS stream with name based on the location header retrieved from the on_publish URL.

Actual behavior

RTMP stream has proper, changed name. HLS doesn't.

Steps to reproduce the behavior

rtmp {
    server {
        listen 1935;

        notify_method get;

        application app {
            live on;
            idle_streams off;

            allow publish all;
            allow play all;

            hls on;
            hls_path /tmp/app;
            hls_nested on;

            on_publish http://127.0.0.1/publish;
        }
    }
}

http {
    default_type application/octet-stream;
    sendfile on;

    server {
        listen 80;

        root /tmp/app/;

        location /publish {
            return 302 new-stream-name;
        }
    }
}

RTMP stream published to rtmp://127.0.0.1/app with old-stream-name stream key is playable via RTMP protocol with URL: rtmp://127.0.0.1/app/new-stream-name and improperly at URL: http://127.0.0.1/old-stream-name/index.3u8, it should be http://127.0.0.1/new-stream-name/index.3u8 instead.

winshining commented 4 years ago

@ham3r PR merged, thank you!