让Pusher JS客户端在PhantomJS中工作

Getting the Pusher JS client working in PhantomJS

本文关键字:PhantomJS 工作 客户端 Pusher JS      更新时间:2023-09-26

在硒测试期间使用PhantomJS时,我遇到了让Pusher客户端连接的问题。图书馆从不脱离联系。

控制台日志:

Pusher : State changed : initialized -> connecting (undefined:undefined)
Pusher : Connecting : {"transport":"ws","url":"wss://ws.pusherapp.com:443/app/8f2c58afe761d56c83dc?protocol=7&client=js&version=3.0.0&flash=false"} (undefined:undefined)
binded (undefined:undefined)
Pusher : State changed : connecting -> unavailable (undefined:undefined)
Pusher : Connecting : {"transport":"ws","url":"wss://ws.pusherapp.com:443/app/8f2c58afe761d56c83dc?protocol=7&client=js&version=3.0.0&flash=false"} (undefined:undefined)
Pusher : Connecting : {"transport":"ws","url":"wss://ws.pusherapp.com:443/app/8f2c58afe761d56c83dc?protocol=7&client=js&version=3.0.0&flash=false"} (undefined:undefined)

以下是Django中的一个小项目,展示了这个问题。

PhantomJS似乎在websocket方面存在一些问题。这些问题在2.0中得到了修复。安装phantomjs 2.0修复了这个问题。