Answer the question
In order to leave comments, you need to log in
How to create a persistent tunneling connection with php?
If a gray IP server sends a request to a white IP server, can the white IP server send a response indefinitely, thus creating a persistent tunneling connection?
I am writing a tunnel in php, I need to optimize this technology.
I outlined my solution for optimization above. Can it be implemented?
Will NAS timeouts bother me?
Can php receive and process some of the information? (Since one server response lasts indefinitely and it naturally needs to be processed in parts).
Can php send information in chunks? (More on buffering, please).
The technology is designed to store search engine indexing results on a server with a gray IP, and access it through the hosting hash, since the hosting has a high connection speed with the client, and you don’t want to buy a white ip for the server, since it is planned to move the server frequently and every time it will be inconvenient to buy, I also plan to have more than one server, but rather than messing around with ports, hang each server on its own port, it would be better to write a small tunnel in php. I don’t want to use programs for tunneling, since servers can be with different OSes and in general this is a fuss. And besides, I am writing a framework and its users will really like the new feature - this will be one of its chips (the framework should not require any extensions, programs, plugins, etc., except for the php handler and any http server - this is another feature ).
Answer the question
In order to leave comments, you need to log in
I read all the questions and answers on the topic.
In my opinion, in general, the problem is sucked from the finger, but now it’s not about that.
1. It is not clear for whom this is being done. Just for yourself or there will be users of your solution.
If there are N users, then will your white server die from constant page reloading (DDos).
2. similar to the first one, only with regards to the base and other resources on the server. Hosting provider won't send for constant overload?
3 PHP black box. I can't recommend solutions without knowing how php is cut on white hosting.
4. Closer to the body. I think everything is implemented on your servers like this:
Request -> web server (apache, nginx) -> php (fpm, cgi)
All of them are designed to die (i.e. both the web server and php have settings for the lifetime of the request) and, accordingly, there can be no endless single requests in this context (for http).
People have long figured out how to get around this: long pooling, web sockets. They even came up with a php that doesn't die (Reactphp).
But whether these solutions are possible for you depends on paragraph 3 (see above)
5.
Can php receive and process some of the information? (Since one server response lasts indefinitely and it naturally needs to be processed in parts).
Can php send information in chunks? (More details about buffering, please).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question