What happens first? Does anyone know how the Apache server will handle this request?

To keep things simple, please allow the “assumption” that some code requires the use of a full URL, even if the domain is on the same server, i.e. a simple file path cannot be used.

TCP / IP ?? Question: If the form action target = " http://this-full-URL.com/postdata " (for example) and , this URL is also located on the same server, then what happens first?

A) Data is sent "on the Internet" and then returned to the same server, or

B) Before sending any (possibly sensitive) data, the server (Linux, Apache, PHP) first "detects" the target address is local, therefore (understandably) no data is sent through the network? Thank.

+3
source share
2 answers

The correct answer is always A .:-)

It just happens that when the browser and server are running on the same computer, the Internet will be shorted by the local TCP / IP stack. However, Apache and PHP are not involved in this decision; this is the pure functionality of the OS network stack.

, NAT DNS- / NAT, / NAT . , , , DNS- URL- IP- , .

+5

, TCP . , .

+1

Source: https://habr.com/ru/post/1740096/


All Articles