我正在尝试从我的本地网站建立一个 wamp 连接。我在服务器端使用 Ratchet/Wamp,在客户端使用 autobahn|js。该服务运行良好,我能够连接,onOpen/onClose 回调正在服务器上触发。
但是当我从浏览器连接时,连接的 onopen 回调永远不会被调用。相反,控制台日志显示以下内容:
"AutobahnJS debug enabled" autobahn.js:123:6
"Ok, Autobahn loaded" "0.9.9" wamp.php:28:1
"trying to create WAMP transport of type: websocket" autobahn.js:732:6
"using WAMP transport type: websocket" autobahn.js:732:6
Array [ 1, "blablaRealm", Object ] autobahn.js:732:6
"WebSocket transport send" "[1,"blablaRealm",{"roles":{"caller":{"features":{"caller_identification":true,"progressive_call_results":true}},"callee":{"features":{"caller_identification":true,"pattern_based_registration":true,"shared_registration":true,"progressive_call_results":true,"registration_revocation":true}},"publisher":{"features":{"publisher_identification":true,"subscriber_blackwhite_listing":true,"publisher_exclusion":true}},"subscriber":{"features":{"publisher_identification":true,"pattern_based_subscription":true,"subscription_revocation":true}}}}]" autobahn.js:732:6
"WebSocket transport receive" "[0,"19232286535719350273b26118584308",1,"Ratchet\/0.3.4"]" autobahn.js:732:6
"failing transport due to protocol violation: unexpected message type 0" autobahn.js:732:6
InvalidAccessError: A parameter or an operation is not supported by the underlying object autobahn.js:5308:0
InvalidAccessError 是在调用可能从未正确初始化的 websocket 对象上的 close 方法期间,我希望在我知道导致主要问题的原因之后这会消失,我完全不知道如何解决此时此刻。
你知道发生了什么吗?我正在使用的 Ratchet 和 Autobahn 之间是否存在不兼容?两者都声称遵守标准,但这就是我现在所能想到的,对 Wamp 来说是新手。