Web (3)

Source: Internet
Author: User

WEB Proxy

1. Intermediate media: media that exists in the path between the client and the server, such as proxy, gateway, and tunnel
2. Role of intermediate media
The emergence of intermediate media can help both clients and servers and reduce unnecessary communication. For example, the intermediate media can have its own high-speed cache, so that it can directly return the response to the client without involving the original server. When the intermediate media is close to the client, the client feels that the delay time will be shorter. Because only one short distance is required for message transmission, the network load is also reduced, and the intermediate media also reduces the server load. Intermediate media is a program that can be on the same machine as the originating request or on different machines.

3. Proxy definition:
An intermediate media program acts as both a server and a client to forward requests. The proxy is usually used as a portal through the network firewall. the proxy server receives requests from other clients and provides services for them, or pass these requests to other servers (and perform possible conversions [convert http to another protocol ])

4. Gateway

Generally, when a message is forwarded to a non-HTTP server (such as an email or FTP Server), the gateway converts the HTTP request to another service protocol, the response will return to the Gateway. After the gateway converts the response, it forwards the response to the original sender.

The gateway is also called the inter-network connector and Protocol converter. The gateway is the most complex network interconnection device on the transport layer to achieve network interconnection. It is only used for different network interconnection between two high-level protocols. Gateways can be used for both Wan and LAN interconnection;

A gateway is essentially an IP address from A network to another network. For example, A and B belong to two different network segments. Without A router, the two networks cannot communicate with each other over TCP/IP. If the sub-accounts in A need to communicate with the sub-accounts in B, the sub-accounts in A first send the message to the Gateway in A, and then the gateway in A sends the message to the Gateway in B, the Gateway in B sends the message to a sub-machine in B. Therefore, the TCP/IP protocol can communicate with each other only when the IP address of the gateway is set. The IP address of the gateway is the IP address of a device with the routing function, such as a router

5. sudo
The channel is an intermediate media that relay data between two connections. It does not analyze or interpret the HTTP messages that pass through it. Instead, it only reads the request line (the first line of the HTTP message) to locate the host to be connected. The channel does not cache the response at a high speed. Its survival time is the same as the communication time between the two sides. If the two sides of the connection are closed, the channel no longer exists.

6. Advanced proxy Classification

A. Regular proxy and high-speed cache proxy

The regular proxy only forwards requests and responses without caching them. The high-speed cache proxy also maintains a private bucket that stores previously received responses.

B. Transparent proxy and opaque proxy

The transparent proxy only performs superficial modification on the received message, for example, adding authentication information related to itself or the server that receives the message, no in-depth changes will be made to requests or responses,

The opaque proxy can deeply modify requests and responses. A typical modification to the request is anonymous, with the aim of hiding the client information; an example of modifying a response is the conversion of the media type-converting an image from one format to another to reduce the number of responses

7. Proxy applications

A. Shared WEB Access

The client shares Internet connectivity through a proxy and can share resources at the same time. If multiple clients request the same resource from the original server, you only need to establish a single connection between the proxy and the original server. Otherwise, a separate connection must be established between each client and the original server to increase the load on the original server. If a request is sent for different resources, the proxy can queue these requests [serialized]. If the response to the first request is delayed, the second request will also be delayed.

B. Adjust cache response

The proxy's high-speed cache function is optional and can be configured.

C. anonymous client

Proxy plays an important role in hiding the identities of each client behind it. When a WEB request is forwarded to the original server by proxy, the original server considers that proxy is the client that sends the request and does not know which WEB Client is next to the proxy.

D. Conversion request and response

E. act as a gateway for non-HTTP Systems

The proxy can act as the intermediate media between the WEB Client and the FTP server. The proxy works as it is used as the WEB intermediate media: the client requests are forwarded to the server and the response is returned to the client. However, because the WEB Client and FTP server use different protocols, the proxy must convert the HTTP request of the client into an FTP request and format the response of the FTP server as an HTTP response, therefore, the proxy acts as a gateway.

F. filter requests and responses

Acts as a guard to filter out inappropriate requests and responses. The proxy can filter out specific requests based on the destination site [for example, some websites are prohibited from being accessed within the company], or according to the response size or response data format [for example: virus: filters out specific responses based on such features.

8. HTTP requests containing proxies

A. the browser searches the Domain Name System for A proxy configured in advance, finds the IP address of the proxy server, and establishes a tcp connection with the proxy server (Steps 1 and 2)

B. the browser sends an HTTP request to the proxy server (Step 3)

C. The proxy server performs DNS lookup on requests from the original server, finds the IP address of the original server, and establishes a TCP connection with the original server (step 4 and 5)

[Technically, browsers and proxies can use different DNS servers to complete their respective searches]

D. The proxy sends the HTTP request to the original server (Step 6)

E. The original server sends the HTTP Response to the proxy (Step 7), and then the proxy forwards the HTTP Response to the browser (Step 8)

[In this phase, the browser can choose to establish a parallel connection with the proxy, and the proxy can choose to establish a parallel connection with the original server (Step 9, 10 )]

Related Article

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.