sannremy / php-push-websocket Goto Github PK
View Code? Open in Web Editor NEW:arrow_up_down: Lightweight implementation of WebSocket protocol in PHP
:arrow_up_down: Lightweight implementation of WebSocket protocol in PHP
there is a bug when I try to send long text messages from client to the server, I did not count at what length does the error occur.
the problem is the either only half the text gets received or sometimes the whole text is corrupted.
In my opinion, the problem is due to the unmask() function
Hello srchea, is there any change to be made in Push WebSocket when we access with https? In your code, this condition does not occur "if(preg_match("/Sec-WebSocket-Version: (.*)\r\n/", $headers, $match))", it is as if the altered header when accessed via https... I changed the client to wss://, but it enters the condition that displays on the console: "The client does not support WebSocket".
Hey, everytime I refresh my browser I get this error message:
socket_shutdown(): unable to shutdown socket [57]: Socket is not connected.
Any idea?
Hello,
I have tried this command
composer require "srchea/php-push-web-socket"
and given this error
Root package 'srchea/php-push-web-socket' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?
Remark: and with composer install given same error!
Thanks for support.
As you know, pcntl_*
functions have limitation to use. for example:
php.ini
for security reason.Is it possible that you do not use pcntl_fork
and use else?
Hello;
First I'll like to thank you for this piece of code, I being looking for something like this for a good time already and just when I decided to create it myself I found yours... Thanks.
I was able to place it all in the same manner you have set in your test and after some debugging I was able to make it all work, the only problem is that I just keep getting the following answer when running from the client side:
WebSocket connection to 'ws://127.0.0.1:5001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
As you can see I'm running it on the same address/port you have in your test but there is no way to get it to work, I'm connecting from a computer in the same network of the server and the port 5001 is open on my server and waiting for connections, if you can please let me know what can I do to have it all working.
Thanks in advance.
Whenever I try to send a message greater than 125 characters to the client.
The client doesn’t seem to receive any more messages after that.
I have tested it with text of varying lengths but this happens only when there are more than 125 characters.
Fatal error: Call to undefined function pcntl_fork() ??
Hello. Can you write an example client?
Not work.
Hi,
I'm trying to setup your example through NGINX proxy with or without SSL.
But I'm unable to get it working. When I access the websocket server directly it works perfectly.
Thank you
Regards
Done
Sometimes socket_write() throws unable to write to socket
:
string(78) "ErrorException[2]: socket_write(): unable to write to socket [32]: Broken pipe"
string(96) "/test/vendor/srchea/php-push-web-socket/src/PushWebSocket/Server.php[308]"
string(848) "Trace:
#0 /test/vendor/srchea/php-push-web-socket/src/PushWebSocket/Server.php(308): socket_write(Resource id #26, '�I am waiting 2 seconds', 24)
#1 /test/vendor/srchea/php-push-web-socket/src/PushWebSocket/Server.php(294): PushWebSocket\Server->send(Object(PushWebSocket\Client), 'I am waiting 2 seconds')
#2 /test/vendor/srchea/php-push-web-socket/src/PushWebSocket/Server.php(250): PushWebSocket\Server->startProcess(Object(PushWebSocket\Client))
#3 /test/app/modules/shell/tasks/WebsocketTask.php(25): PushWebSocket\Server->run()
try to telnet to 127.0.0.1:5001 and after connecting just close the connection. Server goes into infinite cycle to try a handshake or something. Not sure what is that - but nothing good
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.