php - Does laravel5.4's broadcast system need to set up its own websocket?
PHP中文网2017-06-26 10:48:59
0
1
799
Looking at the documentation, I found that there is a pusher redis driver. Are these just auxiliary websocket? If I want to use the broadcast function, do I need to set up websocket related things myself?
The document mentions 3 types of driversPusherRedisSocket.IO
Among them, Pusher is a third-party service. Generally not considered
Redis, as the name suggests, pushes messages to redis. Then you need to write another program to sub subscribe to redis messages. and sent to the client. This basically amounts to doing nothing. . .
So generally we use the Socket.IO driver. As we all know, if the client wants to establish a websocket connection to the server, the server must have a long-running process to accept the connection. The tlaverdure/laravel-echo-server mentioned in the document is such a process. The browser actually establishes a connection to it. Then your PHP program pushes the message to this process, and this process sends it to the browser for you.
http://laravelacademy.org/pos...
The document mentions 3 types of drivers
Pusher
Redis
Socket.IO
Among them, Pusher is a third-party service. Generally not considered
Redis, as the name suggests, pushes messages to redis. Then you need to write another program to sub subscribe to redis messages. and sent to the client. This basically amounts to doing nothing. . .
So generally we use the Socket.IO driver. As we all know, if the client wants to establish a websocket connection to the server, the server must have a long-running process to accept the connection.
The tlaverdure/laravel-echo-server mentioned in the document is such a process. The browser actually establishes a connection to it. Then your PHP program pushes the message to this process, and this process sends it to the browser for you.
end.