rtp2httpd icon indicating copy to clipboard operation
rtp2httpd copied to clipboard

希望增加https方式的访问

Open hkbase opened this issue 6 months ago • 5 comments

使用场景:cloudflare tunnel + rtp2httpd 在浏览器里访问 https://CF隧道域名/playlist.m3u 获取到内容后,里面的直播地址都是以http开头的,希望通过rtp2httpd.conf配置文件参数设定,支持在playlist.m3u文件里输出https开头的直播链接地址,这样客户端在发起直播请求时就都是走cf的443加密通道了。 非常感谢🙏开发者的辛苦付出,致敬幸福安康~~

hkbase avatar May 13 '26 16:05 hkbase

location / {
    proxy_pass http://192.168.31.1:5140;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    
    # 关键:改写 M3U 中的 HTTP 地址为当前 HTTPS 域名
    sub_filter 'http://192.168.31.1:5140/' 'https://tv.domain/';
    sub_filter 'http://tv.domain/' 'https://tv.domain/';
    sub_filter_types *;
    sub_filter_once off;

    # 流媒体需要关闭缓冲
    proxy_buffering off;
    proxy_cache off;
}

lsbintop avatar May 14 '26 03:05 lsbintop

我是直接利用cloudflare tunnel对接rtp2httpd的监听端口,想要实现rtp2httpd生成的playlist.m3u里的直播地址以https开头。

hkbase avatar May 14 '26 14:05 hkbase

需要开启 rtp2httpd 的 xff 选项 https://rtp2httpd.com/guide/public-access#%E5%89%8D%E7%BD%AE%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86

stackia avatar May 15 '26 04:05 stackia

需要开启 rtp2httpd 的 xff 选项 https://rtp2httpd.com/guide/public-access#%E5%89%8D%E7%BD%AE%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86

收到,完美解决,非常感谢🙏~~~ xff = yes

hkbase avatar May 15 '26 23:05 hkbase

3.16.0 版本的 xff 选项失效了

wolonggl avatar Aug 22 '26 03:08 wolonggl