04 MU class Network "Attack on node. JS Foundation (i)" HTTP explanation

Source: Internet
Author: User

HTTP: Communication protocol

Process Overview:

HTTP client originating request, creating port default 8080

HTTP server listens for client requests on port

HTTP server returns status and content to client

A little more detailed analysis:

1. Domain Name resolution: Browser Search for its own DNS buffer, to see if there is a requested domain name defined by the IP, buffer 1 minutes

# # Google Browser input:
Chrome://net-internals/#dns

2. Search for DNS buffering of the operating system itself (no browser buffering or invalidation)

3. Read the local Host file

C:\Windows\System32\drivers\etc

4. Browser initiates a DNS call to the system

-Broadband carrier server view itself cache

-The carrier server initiates a request for DNS resolution from an iteration (starting with the IP corresponding to the domain name)

The carrier server caches the resulting IP back to the operating system core

The operating system kernel sends IP back to the browser

The final browser gets the IP address of the domain name

5. After the browser obtains the domain name corresponding IP, initiates the HTTP " three times Handshake "

-the browser's random port (8080) sends a TCP connection request to the server,

The request passes through the routing device, the network card, the TCP/IP protocol stack of the kernel, and the firewall eventually arrives at the Web server

After the 6.TCP/IP connection is established, the browser sends an HTTP request to the server

-for example, use the Get method of HTTP to request the domain name of a root domain, rest can use HTTP 1.0 protocol

7. The server side receives the request, according to the path parameter, passes through the backend processing, returns the result data to the browser;

-If the page is the full HTML page code will be returned to the browser

8. The browser gets the HTML page code and starts parsing and rendering

-HTML page of JS, CSS, pictures and other static resources also need to go through a HTTP request to repeat the above steps to obtain

9. The browser combines HTML and static resources to render the full page

Requests and responses

The entire process of HTTP can be summed up as a request and response two parts

Both will send HTTP headers and body information

HTTP Header

Additional Information: Content type, Server send response date, HTTP status code

Body Information

User-submitted form data, or the returned data

Request method for HTTP

Get: GET, read data

POST: Submitting data to a specified resource

PUT: Update

Delete: Remove

HEAD: Similar to get, the server does not return all data

Status code
1xx The identity request is accepted
2xx The request was successfully accepted and disposed of
3xx redirect
4xx Client Error
5xx Server-side Error

Common Status Codes
200 Client request succeeded
400 Client request has syntax and other errors, server side does not understand
60s Request not authorized
403 Server-side deny, due to permissions and other reasons
404 Resource not Found
500 Unexpected error on server side
503 The server is currently unable to process, maybe sometime

04 MU class Network "Attack on node. JS Foundation (i)" HTTP explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.