Websocket 发表于 2018-05-25 | 更新于 2018-11-11 | 分类于 PHP | 评论数: | 阅读次数: WebSocket 是一种在单个 TCP 连接上进行全双工通讯的协议。 123456789101112131415var ws = new WebSocket(url, [protocol] );var ws = new WebSocket("ws://example.com", [protocol] );ws.onopen = function (){ ws.send('message');}ws.onmessage = function (evt){ var received = evt.data;}ws.onclose = function (){}