WebSocket 的端口是什么?

What is the port of WebSocket?

  1. WebSocket的端口号是多少?

  2. WebSocket使用什么协议?

  3. 当防火墙阻止除 80 和 443 端口以外的所有端口时,WebSocket 是否工作?

What is the port of WebSocket?

WebSocket 握手通过 HTTP 操作,因此端口是 HTTP/WebSocket 服务器想要使用的任何端口。未加密 HTTP 标准为 80,加密 HTTPS 标准为 443。

What protocol does WebSocket use?

“WebSocket 协议”规范是 RFC 6455

Does WebSocket work when the firewall blocks all but 80 and 443 ports?

是,如果 HTTP/WebSocket 服务器决定使用这些端口进行 WebSocket 连接。