ghedipunk / PHP-Websockets

A Websockets server written in PHP.
BSD 3-Clause "New" or "Revised" License
917 stars 374 forks source link

Not working in Chrome 19 and up #4

Closed csanad closed 10 years ago

csanad commented 12 years ago

For some strange reason the server is not accepting connection from the recent Chrome on Windows. Still works nicely with Firefox though. What is more strange, it is working nicely on Linux with the recent Chrome. I tried to dig for some information, and I guess the problem related to the frame masking, and from now "A server must not mask any frames that it sends to the client." Any solution for this?

ghedipunk commented 12 years ago

This server shouldn't be masking any frames that it's sending to the clients.

I'll get right on researching this.

patrickhafner commented 11 years ago

cannot reproduce this behaviour on chrome 26 with mac os x 10.8.3. it just works pretty good

recordmob commented 11 years ago

I have this working, but for the life of me I can't disconnect the client. Anybody else having issue doing this? The big problem being is the client refreshing the screen the client basically can't connect again. And the connection.close close from javascript seems to produce nothing from the PHP script. Also, seem to be having problems sending more than one command, but that's ancillary.

ghedipunk commented 10 years ago

Found the issue, jessejamesrichard.

The deframing method returns false if the frame is incomplete, to allow the frame to be cached until it has completely arrived.

If a connection is closed, it returns an empty string, which evaluates to false. Because of this, the processing loop continued waiting for more input on that user's connection, blocking additional connections from the same user.

The fix is to add explicit checking for boolean false.