PHP Emitter for socket.io v4

1.2k Views Asked by At

I've been trying to implement a PHP client for socket.io v4. Though this looks easy, I've noticed the following trends within GitHub:

  1. The client is a Redis emitter (?)
  2. The client is not compatible with socket.io v4
  3. The client simply is not connecting to the socket.io server (encryption issue I guess)

The question remains, however. Is there a compatible PHP client class for socket.io v4?


This client is the one that looks ok but is not compatible with v4.

First, on line 77 I've updated the code to make the queries compatible with socket.io v4:

public function __construct($host = null, $port = null, $path = "/socket.io/?EIO=4")

Diving a little deeper on line 311, php is writing the encrypted data onto the socket. This is where the handshake is performed. But no correct data is being sent over the socket.

fwrite($fd, $this->hybi10Encode('42["' . $this->event . '", "' . addslashes($this->getData()) . '"]'));
0

There are 0 best solutions below