elephant.io
elephant.io copied to clipboard
Undefined index: upgrades
Getting this error:
Undefined index: upgrades
/var/www/html/ClearionLabsPHP/vendor/wisembly/elephant.io/src/Engine/SocketIO/Version1X.php:153
/var/www/html/ClearionLabsPHP/vendor/wisembly/elephant.io/src/Engine/SocketIO/Version1X.php:48
/var/www/html/ClearionLabsPHP/vendor/wisembly/elephant.io/src/Client.php:59
/var/www/html/ClearionLabsPHP/main/SocketHelper.php:14
...
...
from elephant.io/src/Engine/SocketIO/Version1X.php Line 153:
...
if (!in_array('websocket', $decoded['upgrades'])) {
throw new UnsupportedTransportException('websocket');
}
Here is my initialization in SocketHelper.php:
$client = new Client(new Version1X($url));
$client->initialize();
$client->emit($event, $msgBody);
$client->close();
What's the result of the $result
?. Just print it before the line :
$decoded = json_decode(substr($result, strpos($result, '{')), true);
ping @sclearion, could you print out the result as @vincentdieltiens suggested ? Thanks !
Hi. I have the same problem. I can connect to my Socket.IO server with JavaScript, but with PHP it fails with a "400 Bad Request Error". I'm using the Elephant.IO Bundle for Symfony (nc/elephantio-bundle v2.0.0) which is requiring wisembly/elephant.io v3.0.* I don't get any other response than "Bad Request - Your browser sent a request that this server could not understand."
Is this the result of the $result
variable ? Could you try to checkout the master
version, as it was not released yet ?