我读到(安全)Websocket 使用的端口与 HTTP(S) 协议相同。但是,我的 PHP Websocket 服务器从客户端接收加密握手,我正在监听 12345 端口上的打开连接。
我的系统通过非安全 websocket 运行良好,但我需要添加安全功能,我不明白为什么我会收到这些加密握手。多亏了 OSI 模型,这对我来说是透明的......
如果我配置 apache 来激活 SSL 引擎并监听 12345 端口。我将无法再次将此端口用于我的 PHP Websocket 服务器,因为它将处于“已使用”状态......或者我忘记了一些东西......
我迷路了 :(
编辑:
这是我的安全 websocket 标头(使用wss://
):
Request URL:wss://localhost:12345/
这里是我的简单 websocket 标头(使用ws://
):
Request URL:ws://localhost:12345/
Request Method:GET
Status Code:101 Switching Protocols
Request Headersview source
Connection:Upgrade
Host:localhost:12345
Origin:http://localhost
Sec-WebSocket-Extensions:x-webkit-deflate-frame
Sec-WebSocket-Key:wovBDvKiKdy/+0Y2BQPr9w==
Sec-WebSocket-Version:13
Upgrade:websocket
(Key3):00:00:00:00:00:00:00:00
Response Headersview source
Connection:Upgrade
Sec-WebSocket-Accept:1ao7ngQG4LAa3JxFibyvoocbSAM=
Upgrade:websocket
(Challenge Response):00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
为什么我在没有安全连接的情况下得到更多?