可以开启IP授权,填写自己的服务器IP,支持多个,防止被别人盗用接口,本地调试把本地IP也填上
宝塔需要设置跨域访问才可以正常播放,设置教程可以搜下网络
APP链接特征填写:.m3u8 (注意前面的点),其他APP理论上相同….
调用方法:域名/?url=示例:http://www.xxx.com/m3u8/?url=
注意宝塔需要设置伪静态才可以正常播放:
<p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">location / {</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">if ( $request_method = ‘OPTIONS’ ) {</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">add_header access-control-allow-headers range;</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">add_header access-control-allow-methods GET,POST,HEAD,OPTIONS;</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">add_header access-control-allow-origin *;</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">return 200;</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">}</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">add_header access-control-allow-origin *;</p><p style="box-sizing: inherit; margin-bottom: 20px; line-height: 1.8; color: rgb(85, 85, 85); font-family: two; font-size: 15px;">}</p>
本站代码模板仅供学习交流使用请勿商业运营,严禁从事违法,侵权等任何非法活动,否则后果自负!
THE END

















暂无评论内容