P
P
PO6OT2015-06-20 17:47:25
PHP
PO6OT, 2015-06-20 17:47:25

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

All questions on the topic:
How to use PHP on a hosting with a "white" IP to make an http tunnel to connect to a server with a "gray" IP, which is behind NAT'om?
How to get http access to a server with a gray IP from the Internet by any means?
There is a technology of clustering. How to optimize it?
How to create a persistent tunneling connection using php?
Will NAS timeouts interfere with my tunneling?
Can php receive and immediately process part of a request without waiting for the request to finish receiving?
Can php send information in chunks?
Most recent discussion.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nonlux, 2015-06-20
@woonem

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

Sorry, nonsense. see item 4
The correct solution would be to send 100 different POSTs from the gray server to the white server. Put everything together on white.
6. In general, if you only need to issue data from a gray server. That will be the simplest implementation of your static http proxy.
Those. gray generates ready-made pages and gives them to white. And he keeps them and gives them out. If the user requests that the gray has not yet processed send it to ... (404)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question