javascript - RatchetPHP no WebSocket property for new connections -




i'm trying access query parameters incoming connections in websocket server's onopen function using ratchet. both official documentation , other stackoverflow posts can accessing websocket property of connectioninterface object passed function:

public function onopen(connectioninterface $conn) {     $query = $conn->websocket->request->getquery(); } 

however, there's no websocket property incoming connection objects. when start server , connect client, notice given, results in fatal error calling function on null object:

php notice: undefined property: ratchet\server\ioconnection::$websocket

i'm using php 7.0 , i'm requiring latest stable release in composer.json:

"require": {     "cboden/ratchet": "^0.3.6" } 

i'm connecting client in chrome js console code copied directly hello world documentation well:

var conn = new websocket('ws://localhost:8080?foo=bar'); conn.onopen = function(e) {     console.log("connection established!"); }; 

if it's helpful, public properties see $conn are:

buffersize stream readable writable closing loop buffer listenerse decor 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -