2

我们使用 Twilio Video 来开发我们的系统,我可以在我自己的笔记本电脑上使用该系统,但工作的笔记本电脑在尝试连接 Chrome 浏览器时出现错误。

我收到以下错误:

WebSocket connection to 'wss://endpoint.twilio.com/' failed: Error during WebSocket handshake: 'Upgrade' header is missing

完整的错误文本如下:

twilio-video.js:20135 WebSocket connection to 'wss://endpoint.twilio.com/' failed: Error during WebSocket handshake: 'Upgrade' header is missing
connect @ twilio-video.js:20135
Transport @ twilio-video.js:20025
(anonymous) @ twilio-video.js:21181
twilio-video.js:14542 Tue Nov 28 2017 11:07:49 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket connection error: {"isTrusted":true}
LoggerFactory.print @ twilio-video.js:14542
LoggerFactory.(anonymous function) @ twilio-video.js:14559
Logger.(anonymous function) @ twilio-video.js:14553
onError @ twilio-video.js:20315
ws.onerror @ twilio-video.js:20155
twilio-video.js:14542 Tue Nov 28 2017 11:07:49 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket disconnected (code: 1006)
twilio-video.js:14542 Tue Nov 28 2017 11:07:49 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket abrupt disconnection
LoggerFactory.print @ twilio-video.js:14542
LoggerFactory.(anonymous function) @ twilio-video.js:14559
Logger.(anonymous function) @ twilio-video.js:14553
onClose @ twilio-video.js:20204
ws.onclose @ twilio-video.js:20147
twilio-video.js:14542 Tue Nov 28 2017 11:07:49 GMT+0300 (Turkey Standard Time) | sip.ua | transport wss://endpoint.twilio.com failed | connection state set to 2
twilio-video.js:14542 Tue Nov 28 2017 11:07:49 GMT+0300 (Turkey Standard Time) | sip.ua | next connection attempt in 28 seconds
twilio-video.js:14542 Tue Nov 28 2017 11:08:17 GMT+0300 (Turkey Standard Time) | sip.transport | connecting to WebSocket wss://endpoint.twilio.com
twilio-video.js:20135 WebSocket connection to 'wss://endpoint.twilio.com/' failed: Error during WebSocket handshake: 'Upgrade' header is missing
connect @ twilio-video.js:20135
Transport @ twilio-video.js:20025
(anonymous) @ twilio-video.js:21181
twilio-video.js:14542 Tue Nov 28 2017 11:08:19 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket connection error: {"isTrusted":true}
LoggerFactory.print @ twilio-video.js:14542
LoggerFactory.(anonymous function) @ twilio-video.js:14559
Logger.(anonymous function) @ twilio-video.js:14553
onError @ twilio-video.js:20315
ws.onerror @ twilio-video.js:20155
twilio-video.js:14542 Tue Nov 28 2017 11:08:19 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket disconnected (code: 1006)
twilio-video.js:14542 Tue Nov 28 2017 11:08:19 GMT+0300 (Turkey Standard Time) | sip.transport | WebSocket abrupt disconnection
LoggerFactory.print @ twilio-video.js:14542
LoggerFactory.(anonymous function) @ twilio-video.js:14559
Logger.(anonymous function) @ twilio-video.js:14553
onClose @ twilio-video.js:20204
ws.onclose @ twilio-video.js:20147
twilio-video.js:14542 Tue Nov 28 2017 11:08:19 GMT+0300 (Turkey Standard Time) | sip.ua | transport wss://endpoint.twilio.com failed | connection state set to 2
twilio-video.js:14542 Tue Nov 28 2017 11:08:19 GMT+0300 (Turkey Standard Time) | sip.ua | next connection attempt in 30 seconds
twilio-video.js:14542 Tue Nov 28 2017 11:08:49 GMT+0300 (Turkey Standard Time) | sip.transport | connecting to WebSocket wss://endpoint.twilio.com

我们甚至不明白实际上是什么问题。

4

1 回答 1

0

此错误消息意味着您正在尝试连接到 HTTP 服务器而不是 WebSocket 服务器。

可能的原因:

  1. 您使用的 URI 不正确(过去我见过这种格式的正确 twilio websocket URI:wss://xxx.endpoint.twilio.com。在您的示例中,缺少 xxx 部分)
  2. 你在一些不支持 WebSocket 的 HTTP 代理后面
于 2017-12-05T09:18:28.317 回答