# docker config for srs.
# @see full.conf for detail config.

listen              61629;
max_connections     1000;
# For docker, please use docker logs to manage the logs of SRS.
# See https://docs.docker.com/config/containers/logging/
srs_log_tank        console;
daemon              off;
http_api {
    enabled         on;
    listen          61630;
    auth {
      enabled on;        # 启用鉴权
      username srs888;    # 设置管理员用户名
      password srs888; # 设置密码
    }
}
http_server {
    enabled         on;
    listen          61631;
    dir             ./objs/nginx/html;
}
rtc_server {
    enabled on;
    listen 61632;
    # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
    candidate $CANDIDATE;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    rtc {
        enabled     on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp on;
    }
    dvr {
        enabled         on;
        dvr_apply       all;
        dvr_plan        session;
        dvr_path        /live_record/[app]/[stream]/[2006]-[01]-[02]_[15]-[04]-[05]-[999].mp4;
        dvr_duration    60;
        dvr_wait_keyframe       on;
        time_jitter             full;
    }
    http_hooks {
        enabled         on;
        on_publish      http://dj-multictrl-api:8080/api/srs/on_publish;
        on_unpublish    http://dj-multictrl-api:8080/api/srs/on_unpublish;
        on_play         http://dj-multictrl-api:8080/api/srs/on_play;
        on_stop         http://dj-multictrl-api:8080/api/srs/on_stop;
        on_dvr          http://dj-multictrl-api:8080/api/srs/on_dvr;
        on_hls          http://dj-multictrl-api:8080/api/srs/on_hls;
        on_hls_notify   http://dj-multictrl-api:8080/api/srs/on_hls_notify;
    }
    publish {
        firstpkt_timeout 60000;
        normal_timeout 60000;
    }
}
