Modify an existing PHP Websocket Class - Requires in-depth knowledge
$10-30 USD
Cancelled
Posted almost 10 years ago
$10-30 USD
Paid on delivery
[Introduction]
I am running a PHP Web Socket server ([login to view URL])* on my local LAMP machine (Debian/Linux + Apache + mySql+ PHP Version 5.4.4-14+deb7u12) - ipAddress: [login to view URL]
[Problem]
This* PHP Websocket server is Async however every time I connect to it, I get the following:
[07/11/2014 01:01:10] 4075 : WebClient: Client is version 13, proceeding to handshake...
[07/11/2014 01:01:10] 4075 : WebClient: Looks like client 'Resource id#7' disconnected
(...)
I have tried a number of different HTML/Javascript Websocket clients and they work ok with other PHP Websocket classes, except this* one.
Also, if I decide to not wait for the handshake and quickly send a message from client; it will appear on my shell window, however the client immediately disconnects (I dont know why and this is script looks too slow).
Ok I think this* server is too complicated, and I really prefer this one -> ([login to view URL])** which works fine!
The problem with this** one is that is not ready for Async processing like the first* one; but it is much more light and simple to use, and after all, it works!
[Your job - Part 1]
1.1. Modify this** server class and make it work like this*. In other words, I need the second** server to simultaneously deal with clients with no interruptions (probably using the PHP Extension PCNTL() that this* class uses). If you try to run this** server, and connect two clients, they can chat with each other, however, if you put an if ($clientID==1) sleep(15); inside the wsOnMessage() function, when the clientID 1 sends a message, the server will hang and not even accepts any connections nor process/stream messages from the other client (until the next 15 seconds had gone of course). This means the server deals with one message at a time, which I don't want. I am aware that it is the natural PHP way to do it.
[Your job - Part 2, if possible - not mandatory]
2.1. Make it work over a SSL Connection -> WSS rather than WS (I don't have any SSL certificate yet. Don't know exactly if you can work without one just for local test purposes)
2.2. Protect it from DDoS attacks (is it even possible?)
[Important Notes]
Be advised: I will connect to local mySql server (persistent connection) and will use this *same* connection between clients. It will just store some backup stuff, nothing too complicated. Also, the server must be capable of running 500 to +25.000 WebSocket connections.
Your solution must preferably work within available PHP Extensions (no external dependencies) unless you have a much better solution in mind.
[Reason for my project]
Ok, my project intent is to interpret client messages and return something back. That "something" (aka TASK) could take a while to be returned (<1 second or maybe 2) so I don't want one client to wait until the server finishes a task, before starting another task. I want the server to process multiple tasks simultaneously (that's what I call Async, don't know if it is the correct terminology).
I am a little bit in a hurry with this so will award this project asap and maybe will need you again or start another project with something else I have in mind.
Don't know exactly if you will bid for task 1 or task 1 and 2 and have no idea on how much effort you required to do each, so I will start with a low indicative budget. Please do not bid if you have no time and or know-how to do it!
Happy bidding!