You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
I've got a websocket server and I connect to it both with a PHP client and a browser JS client. On localhost, with unsecure connection it works fine. On production however, where wss:// is used, the PHP client can talk to the server normally, the browser client however encounters "Connection closed before receiving a handshake response".
I dug a bit into it, and found out, that the request from the PHP client looks like this:
Interesting your patch with $buffer === 'G' because in my all test, i've endup with empty string, not G
The problem is clearly in the SSL handshake but I've still not find the cause.
Best Practice advice
You should prefer deal the encryption between the client and a loadbalancer / webserver proxy because you will be able to have better control of the stream and deal with high availability. In this case only the part between client and proxy are encrypted, then proxy to your server are in non encrypted mode, as this should be done in private subnet where you have high trust.
Hi.
I've got a websocket server and I connect to it both with a PHP client and a browser JS client. On localhost, with unsecure connection it works fine. On production however, where
wss://
is used, the PHP client can talk to the server normally, the browser client however encounters "Connection closed before receiving a handshake response".I dug a bit into it, and found out, that the request from the PHP client looks like this:
The request from the browser looks like this
But if I read from the buffer again (after https://github.com/hoaproject/Websocket/blob/master/Server.php#L98), I'm getting all the rest:
ET /{accessToken} ...
I did an ugly hotfix in my project. I extended the
Server
class and added indoHandshake
:And this way it works. But I have no idea, what the underlying issue is.
The text was updated successfully, but these errors were encountered: