When developing php-based im communication tools on the server (web or app may be used), generally, http is used for logon and registration, this part can be implemented through nginx or apache. persistent connection message push. the socket persistent connection must be independent on the server... when developing php-based im communication tools on the server (web or app may be used), generally, http is used for logon and registration, this part can be implemented through nginx or apache. the persistent connection message push module uses the socket persistent connection. the socket persistent connection on the server must be a separate service to push data, so how does the server verify the validity of the client connection when the client sends messages based on the socket persistent connection? how is a general verification solution designed?
Reply content:
When developing php-based im communication tools on the server (web or app may be used), generally, http is used for logon and registration, this part can be implemented through nginx or apache. the persistent connection message push module uses the socket persistent connection. the socket persistent connection on the server must be a separate service to push data, so how does the server verify the validity of the client connection when the client sends messages based on the socket persistent connection? how is a general verification solution designed?
You can try to refer to the WorkerMan framework.
In the aspect of verification, it should be safer to use the token of regular update. during each connection, a token based on user information and randomization will be generated.
The most popularSwoole
Is to solve this problem.