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

handshake is not happening 3.1

Open shyamjptpm opened this issue 9 years ago • 8 comments

I am trying to emit an event to socket.io node server from php server but showing error

This server does not support the websocket transport, aborting

when i print the response of handshake i am getting like string(90) "ÿ0{"sid":"UP7lKpV1wXD8QEhdAAA0","upgrades":[],"pingInterval":20000,"pingTimeout":25000}" where upgrades[] array is empty.

shyamjptpm avatar Aug 25 '16 14:08 shyamjptpm

I think this is a problem on socket.io node server, not the php side. As it doesn't seem to indicate that websockets are supported, it crashes.

But maybe an improvement could be made, and avoid using websockets if it's not there. But I think if I forced to have websockets, it's for a reason, but I can't quite recall what it was...

Have you set a different value for the transport option ? It should be polling by default, but maybe you tried to handshake directly with websocket ?

Taluu avatar Aug 29 '16 10:08 Taluu

@Taluu thanks for the reply . Yes i set transport option as websocket instead of polling then it returns false.

shyamjptpm avatar Aug 29 '16 10:08 shyamjptpm

Would you mind setting it on polling and then check what it does ? thanks

(marking this issue as improvement in order to reflect on whether detecting if websocket is used instead of polling and then not bother to upgrade)

Taluu avatar Aug 29 '16 10:08 Taluu

@Taluu i set polling. The response showed in my question was the result. My nodejs version is 1.3.5

shyamjptpm avatar Aug 29 '16 10:08 shyamjptpm

Then this is an issue with you node server, not elephant.io, as it does not return any proper upgrade path. But then again, if no upgrades available, then I don't think we should actually throw an exception.

Taluu avatar Aug 29 '16 11:08 Taluu

hao to keepalive with server?

phpcs avatar Aug 31 '16 10:08 phpcs

This is not the subject of this ticket, and the keepalive is not implemented.

Taluu avatar Aug 31 '16 12:08 Taluu

Thanks!
...But I ' want to know hao to keepalive

phpcs avatar Sep 01 '16 01:09 phpcs