Answer the question
In order to leave comments, you need to log in
Daemons in PHP as forks, is it possible to forward a WS request to such a process?
There is a PHP daemon that spawns forks, which are essentially WS servers, how to access them knowing only the pid from the client, say when using JS, and is such a work model possible? If such a structure is not possible, then how can you implement the launch of a number of WS servers, each for processing its own range of clients?
Answer the question
In order to leave comments, you need to log in
Run them on different ports?
you can specify some parameters when connecting
var ws = new WebSocket("ws://example.com/service?key1=value1&key2=value2");
Maybe. You must have a manager who, by the client's ID, will send his request to the desired server. The principles are about the same as for a distributed cache. There is a function that calculates the required cluster nodes, or there is a storage in which client connections with cluster nodes are stored.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question