知识付费直播使用https方法——CRMEB开源商城系统
全国统一咨询热线:

15817498839

当前位置: 网站首页 > 知识付费直播使用https方法

知识付费直播使用https方法

2023年06月27日 01:49:41  来源:每日必看    

知识付费直播使用https方法

知识付费现在文档中说明不能使用https原因是需要配置wss

微信号:15889440095
添加微信好友, 获取更多信息
复制微信号


第一步nginx配置wss

nginx配置参考

1、已经安装nginx,版本不低于1.3

2知识付费Workerman监听的是20014端口(websocket协议)

nginx配置类似如下:

server {

  location /wss/ {

    proxy_pass http://127.0.0.1:20014;           

    proxy_http_version 1.1;

    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection "Upgrade";

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header X-Forwarded-Proto  $scheme;

    proxy_set_header X-Real-IP $remote_addr;

 }

 

  # location / {} 站点的其它配置...

}

第二步修改websocket服务

配置完成后需要修改知识付费中根目录public/wap/first/zsff/js/WebSocket.js文件用来区别httpshttp访问

    if (document.location.protocol == "https:"){


that.ws = new WebSocket("wss://" + document.domain + "/wss/"+ ":" + port+'?uid='+window.uid+'&room='+window.room);

}else {

that.ws = new WebSocket("ws://" + document.domain + ":" + port+'?uid='+window.uid+'&room='+window.room);

}

第三步在宝塔中给知识付费站点配置证书知识付费后台基础配置下的网站网站链接改成https并且网站所有访问链接均改成https包括微信公众号菜单等

第四步使用命令php think workerman status检查workerman是否开启中若是开启需要使用命令php think workerman stop 关闭然后开启workerman如果关闭直接开启workerman

这样直播使用https就可以实现了



标签:


每日必看相关文章

热门Tags标签
分销商城系统
O2O商城系统
新零售商城系统
APP商城系统
每日必看
已复制微信号

微信号: 15817498839
长按二维码保存到手机!

立即添加微信
复制成功
微信号: 15889440095
添加微信好友, 获取更多信息
我知道了