PHP-Push-WebSocket | Lightweight implementation of WebSocket protocol | Websocket library
kandi X-RAY | PHP-Push-WebSocket Summary
kandi X-RAY | PHP-Push-WebSocket Summary
:arrow_up_down: Lightweight implementation of WebSocket protocol in PHP
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Encode a message
- Runs webserver .
- Handle WebSocket handshake .
- Start a new client process
- Disconnect a client
- Get ID .
- Get socket .
- Get the handshake .
- Get pid .
- Indicates whether the connection is established .
PHP-Push-WebSocket Key Features
PHP-Push-WebSocket Examples and Code Snippets
Community Discussions
Trending Discussions on PHP-Push-WebSocket
QUESTION
I am new to WebSocket
world and even after a week, I still could not find how to use it with PHP
without using any 3rd Party Library. Or not sure if it is even possible.
I have 3 questions,
1) Do we must need to use some 3rd Party APIs or Libraries like Ratchet, PHP-Push-WebSocket or PHP WebSocket to enable PHP to communicate over WebSocket protocol?
2) If your answer to above question is yes then what is the advantage/purpose of using Apache's mod_proxy_wstunnel
?
3) If I use any PHP WebSocket 3rd Party Library, then do I still need to enable and use Apache's mod_proxy_wstunnel
? If No, then again what is the purpose of Apache's mod_proxy_wstunnel?
I went through this Using go-websocket behind Apache mod_proxy_wstunnel. In this question, the OP has indicated some go-websocket but unfortunately the link is giving 404 Error and hence I cannot understand if the user has used any 3rd Party API.
Any help would be highly appreciated. Thanks in advance.
...ANSWER
Answered 2017-Oct-14 at 12:29PHP is not created for WS. Of course you can do this, but it is full of while (true)
and fsock_open
[*]. And you have to have access to the shell to run the WS-server with php-cgi. (usually)
Choose a language that supports threads / asynchronous communication. Now on the top is Node.js. In addition, better use dedicated libraries to support older browsers, etc. If you are thinking about alternatives to ajax then you can use socket.io. If you want to create one-to-all communication (eg chat, broadcast messaging), go one step further and use one of the Bayeux
implementations, for example: Faye.
The mod_proxy_wstunnel
extension adds an extra layer to the WS server. Depending on the configuration, it can support DDoS, queue, load-balancing, local port swapping, and https support. But better use this for nginx.
So, for test you don't need mod_proxy_wstunnel
, and on production, you should add an extra layer of security, eg NGINX ws tunelling.
[*] Sorry, I made some mistakes. PHP has native support for WebSockets. That content is going to set you negatively to WS in PHP.
Websockets are events, and PHP is poorly managed with it.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PHP-Push-WebSocket
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page