[Notes] [HTTP] Chapter 5 of "Graphic HTTP" Web Server Collaborating with HTTP

foreword

  • Where there is input, there must be output. This note is a summary of the knowledge involved in each chapter after I read "Graphic HTTP"
  • The blog will publish each chapter of the book as an article, and the next blog will be published at an uncertain time
  • Some of the notes in the notes have been sorted out after personal understanding, and there may be deviations. Readers are also kindly requested to help point out, thank you.

disclaimer

  • This blog is my notes after studying "Graphic HTTP", which is intended to facilitate review and review, not for commercial purposes.
  • For the sake of convenience, some pictures on the blog are consistent with those in the book, so I didn’t take screenshots by myself, but quoted the picture addresses of other people’s blogs, and thanked these bloggers for their picture beds.
  • This note is used to record my summary of this knowledge. To facilitate future work and study.
  • The content is not complete with the original book, please read it in conjunction with the original book
  • If there is any infringement, please inform and delete it immediately.

Chapter 5 Web Servers Working with HTTP

5.1 Realize multiple domain names with a single virtual host

1. Virtual host

  • There is only one server at the physical level. Using the virtual host function, it can be assumed that there are multiple servers.
  • You can use one server to serve multiple clients.
  • Different websites can be run under the domain name held by each customer.
    • [Because] Multiple Web sites with different host names or domain names can be hosted.
    • [So] When sending an HTTP request, the URI of the host name or domain name must be fully specified in the Host header .

5.2 Communication data forwarding program: proxy, gateway, tunnel

  • Communication data forwarding program function:
    1. Forward the request to the next hop server on the communication link
    2. Accept the response sent from that server and forward it to the client

1. Proxy

  • An application with a forwarding function . (a "man in the middle" between server and browser)

  • Function:

    1. Accept the request sent by the client and forward it to the server.
    2. Accept the response returned by the service and forward it to the client.
  • Without changing the request URI, it will be sent directly to the target server holding the resource ahead.

    • proxy server:
    • Basic behavior: After receiving the request sent by the client, forward it to other servers.
    • During HTTP communication, multiple proxy servers can be cascaded .
      • The forwarding of requests and responses will go through several proxy servers connected like chain locks.
        • When forwarding, the Via header field needs to be added to mark the passing host information .
    • Reasons for use:
      1. Use caching technology to reduce network bandwidth traffic .
      2. Access control within an organization for specific websites .
      3. To obtain access logs for homepage purposes, etc.
    • Origin server:
    • A server holding resource entities.
  • Proxy method:

    • caching proxy
      • When a proxy forwards a response, it pre-saves (caches) a copy of the resource on the proxy server.
      • When the proxy receives a request for the same resource again, it does not need to obtain the resource from the source server, but returns the previously cached resource as a response.
    • transparent proxy
      • When forwarding a request or response, it does not perform any processing on the message .
      • Non-transparent agent : An agent that processes packets .

2. Gateway

  • A server that forwards communication data from other servers .

    • When accepting a request from a client, it processes the request as if it were an origin server that owns resources.
  • Working mechanism is similar to proxy

  • It enables the server on the communication line to provide non-HTTP protocol services .

  • Benefit: Improved communication security

    【explain】

    • Encryption can be made on the communication link between the client and the gateway to secure the connection.

3. Tunnel

  • An application that relays between a client and a server that are far apart and maintains a communication connection between the two .
  • A communication line with other servers can be established as required.
  • Communication using encrypted means such as SSL
  • Purpose: To ensure that the client can communicate securely with the server.
  • The tunnel itself does not parse HTTP requests. (that is, keep it as it is and transfer it to the subsequent server)
  • The tunnel ends when the communicating parties disconnect.

5.3 Save the resource cache

1. Cache

  • A proxy server or a copy of the resource stored on the client's local disk.

  • benefit:

    1. Reduce access to origin servers.
    2. Save communication traffic and communication time.

    • Cache server:
      • A type of proxy server and is classified in the caching proxy type. (That is, when the proxy forwards the response from the server, the proxy server will save a copy of the resource.)
      • Advantage: Using caching can avoid forwarding resources from the server multiple times.
  • The cache has an expiration date

    • 【reason】
      • When the resources on the source server are updated, if the unchanged cache is still used, it will evolve to return the "old" resources before the update.
  • Clients also have caches (i.e. temporary network files )

    • The cache can exist not only in the cache server, but also in the client browser.
    • If the browser cache is valid, there is no need to request the same resource from the server, and it can be read directly from the local disk .
    • When it is determined that the cache has expired, it will confirm the validity of the resource to the source server.
      • If it is judged that the browser cache is invalid , the browser will request new resources again

2. The protocol before the HTTP protocol (just understand it)

  • protocol name use
    FTP(File Transfer Protocol) The protocol to use when transferring files .
    NNTP(Network News Transfer Protocol) Protocol used for messaging in NetNews electronic conference rooms.
    Archie A protocol for searching file information exposed by anonymous FTP .
    WAIS(Wide Area Information Servers) Protocols used to search multiple databases by keyword.
    Gopher A protocol for finding information within a computer connected to the Internet.

Guess you like

Origin blog.csdn.net/weixin_45944495/article/details/130573068