elephant.io icon indicating copy to clipboard operation
elephant.io copied to clipboard

socket.io 3

Open paulvancity opened this issue 4 years ago • 9 comments

Is this compatible with socket.io 3? It seems to connect but my socket server doesn't detect the connection.

paulvancity avatar Nov 19 '20 06:11 paulvancity

Not sure, haven't had a look at socket.io in ages...

As already said, this project is not really maintained anymore, even though PR are still looked at.

Taluu avatar Nov 19 '20 14:11 Taluu

this is really important, please, someone take a look at this, I don't have the knowledge to implement the new methods to this library, but, these links will be useful:

  • https://socket.io/docs/v3/migrating-from-2-x-to-3-0/index.html
  • https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4
  • https://github.com/socketio/socket.io-protocol#difference-between-v5-and-v4

quiquelhappy avatar Jan 14 '21 16:01 quiquelhappy

Try create class:

class Version3x extends Version2X {
    
    
    /** {@inheritDoc} */
    public function getName()
    {
        return 'SocketIO Version 3.X';
    }
    
    /** {@inheritDoc} */
    protected function getDefaultOptions()
    {
        $defaults = parent::getDefaultOptions();
        
        $defaults['version'] = 4;
        
        return $defaults;
    }
}

then: $this->client = new Client(new Version3x($this->url, []));

merigold avatar Jan 19 '21 21:01 merigold

Try my fork https://github.com/tohenk/elephant.io.

tohenk avatar Jan 31 '21 19:01 tohenk

@tohenk thank you for all this work! I just try for my personal use, and now Work on my V3.1.0 Socket.IO server!! Amazing. Thank you again

alfreddagenais avatar Feb 06 '21 05:02 alfreddagenais

Try my fork https://github.com/tohenk/elephant.io.

OMG i love you guy, your fork really work perfectly with socket io 4 server ? I just want to emit events, its only a question of "version" passed ?

SylvainSimon avatar Aug 08 '21 18:08 SylvainSimon

Try my fork https://github.com/tohenk/elephant.io.

Amazing work! It works perfectly!

andyyapwl avatar Sep 08 '21 07:09 andyyapwl

Try my fork https://github.com/tohenk/elephant.io.

really great work!THX,BRO!!!

hyf3513OneGO avatar Feb 18 '22 10:02 hyf3513OneGO

Try create class:

class Version3x extends Version2X {
    
    
    /** {@inheritDoc} */
    public function getName()
    {
        return 'SocketIO Version 3.X';
    }
    
    /** {@inheritDoc} */
    protected function getDefaultOptions()
    {
        $defaults = parent::getDefaultOptions();
        
        $defaults['version'] = 4;
        
        return $defaults;
    }
}

then: $this->client = new Client(new Version3x($this->url, []));

Is this working?

HirenViradia avatar May 03 '22 05:05 HirenViradia