Websocket 连接关闭/完成

时间:2021-07-14 02:45:05

标签: javascript websocket kubernetes-ingress

我已经在我的 Kubernetes 集群上部署了一个 uWebSockets.js 服务器。

我可以从 nodejs Websocket 客户端连接,也可以从 Websocket Chrome 插件连接。

但是当我尝试使用 HTML5 Websocket 从浏览器连接 websocket 时,我无法连接到我的服务器。它直接进入onerror,没有任何消息

WebSocket 连接到“ws://***/?encoding=text”失败:

bubbles: false
cancelBubble: false
cancelable: false
composed: false
currentTarget: WebSocket {url: "ws://***/?encoding=text", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
defaultPrevented: false
eventPhase: 2
isTrusted: true
path: []
returnValue: true
srcElement: WebSocket {url: "ws://***/?encoding=text", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
target: WebSocket {url: "ws://***/?encoding=text", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
timeStamp: 77602741.8
type: "error"

connection from browser

知道为什么它只适用于浏览器吗?

谢谢

0 个答案:

没有答案