Giter VIP home page Giter VIP logo

php-push-websocket's Introduction

php-push-websocket's People

Contributors

coolcheat avatar evnix avatar sannremy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-push-websocket's Issues

Example client.php

Hello. Can you write an example client?

!/usr/bin/php -q

run(); ?>

Not work.

Broken pipe

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()

Error when browser refresh

Hey, everytime I refresh my browser I get this error message:

socket_shutdown(): unable to shutdown socket [57]: Socket is not connected.

Any idea?

Windows 10 Pro composer install error

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.

Problem when sending large text

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

NGINX integration?

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

telnet

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

pcntl_fork()

Fatal error: Call to undefined function pcntl_fork() ??

bug when chars>125

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.

Connection Refused

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.

Client accessing via https

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".

Is it possible that you do not use `pcntl_fork` and use else?

As you know, pcntl_* functions have limitation to use. for example:

  1. Does not support in windows OS.
  2. Does not enable by default and must recompile PHP.
  3. Does not work in PHP as Apache module.
  4. Does not work in Web and just run on CLI.
  5. This function normally disabled in php.ini for security reason.

ref

Is it possible that you do not use pcntl_fork and use else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.