-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https/wss 配置,最新演示环境无法发送消息 #868
Comments
WSS 链接默认是使用 443 端口,其设置识别是否有环境变量:
docker compose 配置 Line 21 in da8f78e
|
https 协议有类似的情况,解决办法是在后端渲染时,使用变量识别,设定 port,见
那么,websockets 也可以使用这个方案。 #846 |
是在docker环境下才出现这个问题吗? |
docker 方式部署,但是该问题应该发生在使用反向代理配置 https/wss 的情况下。 docker 方式启动,docker compose 如下
|
该问题的现象是,环境变量 但是对于反向代理,https/wss 连接的 sockets 是通过 443 端口,所以,原来后端的逻辑是配置一个环境变量: 现在CS_IM_SERVER_SSL_PORT的值没有使用,而是使用了默认的 8036 |
443其实已经生效了,只不过默认不显示,主要的问题是后面的Error during webSocket handshake: Unexpected response code: 502,这个问题应该出在浏览器和反向代理之间 |
首先,从浏览器访问websockets 至 443 已经生效,然后反向代理会访问 contact-center 容器的 8036 端(contact-center 使用的 websocket 端口,使用环境变量 见docker compose yml
现在在演示环境,已经通过访问宿主的机器的 443 端口,经过代理继续请求到 1) 处,那么 websockets 是不是运行在 3)处端口呢?即 8036 ? |
经过查看,目前演示环境中,springboot 中 websockets server 启动服务的端口是 443,所以导致 BUG。
|
那我理解错了 |
现在行为
0712上午 在演示环境 https://demo.cskefu.com/ 测试,发现 无法发送消息
F12控制台提示:
socket.io.js:4163 WebSocket connection to 'wss://demo.cskefu.com:8036/socket.io/?userid=161e47d09233a9e4757b3beaa30a6ba8&session=359B486277B832F88E6DF1C7634DFD07&appid=104eac&osname=&browser=&skill=2c9e80867d65eb5c017d65f17ceb0019&nickname=Guest_%401ks1co&title=%E6%98%A5%E6%9D%BE%E5%AE%A2%E6%9C%8D%20%7C%20%E5%BC%80%E6%BA%90%E5%AE%A2%E6%9C%8D%E7%B3%BB%E7%BB%9F_%E6%99%BA%E8%83%BD%E5%AE%A2%E6%9C%8D_%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%AE%A2%E6%9C%8D&url=https%3A%2F%2Fdemo.cskefu.com%2Ftestclient.html&traceid=a6419758ade04c019e9f27ada49ef26f&EIO=3&transport=websocket'
failed: WebSocket is closed before the connection is established.
预期行为
能正常发送消息
操作系统
解决方案
代码版本
The text was updated successfully, but these errors were encountered: