HTTP 3 proxies, gateways, tunnels

5.

In collaboration with the HTTP Web server

A Web server can set up multiple domain-independent Web sites, but also as a transit server on the communication path to enhance the transmission efficiency.

 

Implement multiple domain names with a single virtual host:

HTTP / 1.1 specification allows a HTTP server set up multiple Web sites. For example, to provide Web hosting services (Web Hosting Service) vendor, you can use a single server to a number of customer service, they can also run their own Web site to a different domain name held by each customer. This is because the virtual host (virtual host) function.

Even if the physical level, only one server, but as long as the use of virtual host feature, you can have multiple servers have been imaginary.

 

When the client uses the HTTP protocol to access the server, often using similar www.hackr.jp this host and domain name.

On the Internet, domain name service through the DNS to map IP addresses to access the target site after (DNS), when a request is sent to the server, the IP address is already in the form of a visit.

So, if hosting multiple domains within a single server, upon receipt of the request would need to figure out exactly which domain name you want to access.

In the same IP address, since the virtual host can register a number of different host name and domain name of the Web site, so when sending HTTP requests, you must specify the full URI host name or domain name in the header Host.

 

Communication data forwarding procedure: proxy, gateway, tunnel:

proxy:

There is a proxy forwarding application, the role of the role of "middle" of the server and the client, receiving the request sent by the client and forwarded to the server, and also receives the response returned by the server and forwarded to the client.

 

Gateway:

When the gateway server to other servers to forward communication data receiving requests from the client, and it's like they own the resources of the same server resources to process the request. Sometimes the client may never notice that their goal is a communications gateway.

 

tunnel:

The tunnel is in transit between the two far apart the customer end and server, and keep both the application communication connection.

 

 

proxy:

Proxy server, do not change the request URI, sent directly to the target server. Server that holds the resource entity is called the source server. From the source server then returns a response through the proxy server to the client.

HTTP communication, multiple proxy servers may be combined. When forwarding, additional Via header field to mark the passing host information.

The reason for using a proxy server: the use of caching technology to reduce network bandwidth traffic , access control within the organization for the site to get access logs for the primary purpose.

Acting can be divided whether to use cache and whether it will modify the message.

Caching proxy: proxy forwards a response, the proxy cache (Caching Proxy) will advance copy of the resource (cache) saved on the proxy server. When the agent receives a request for the same resource again, it can not be acquired from a source server where the resource, but the resource before the cache is returned as the response.

Transparent proxy: forwarding requests or responses, does not do any packet processing type is called transparent proxy agent (Transparent Proxy). On the contrary, the content of the packet proxy processing is called non-transparent proxy.

 

Gateway:

Gateways and agents working mechanism is very similar. The gateway enables the server on the communication line to provide non-HTTP protocol services.

Using the gateway communication security can be improved, as can the encryption on the communication line between the client and the gateway in order to ensure a secure connection . For example, the gateway can connect to the database, query data using SQL statements. In addition, credit card settlement on the Web shopping site, the gateway can be linked and credit card settlement system.

 

tunnel:

A tunnel may be required to establish a communication line with other servers, when the use of encryption, such as SSL communication. The purpose of the tunnel is to ensure that the client can communicate securely with the server.

The tunnel itself will not go parsing HTTP request. That is, the request remains intact after the server transferred. Tunnel will end when the communicating parties are disconnected.

 

 

Save Cache resources:

Cache refers to a copy of the resource stored in the proxy server or the client's local disk. Use caching to reduce access to the source server and, therefore, reducing communication traffic and communication time.

Cache server is a proxy server. When the agent forwarded a response back from the server, the proxy server will save a copy of the resource.

The advantages of caching server that can use the cache to avoid multiple forwarding resources from the source server, the client can obtain resources from the nearest cache server, and the source server do not have to repeatedly deal with the same request.

 

Cache expiration date:

Even if there is a cache in the cache server, it can not guarantee that every request will be returned to the same resources. As it relates to the validity of cached resources.

When faced with resource updates on the source server, if you still use the same cache, it will turn into return before updating the "old" the resources.

Even if there is a cache, also because of the requirements of the client, the cache is valid and other factors, the availability of resources to confirm the source server. If it is determined a cache miss, the cache server will get the "new" resource again from the source server.

 

The client's cache:

Cache can only exist in the cache server, there may also be a client browser. With Internet Explorer program, for example, the client cache is called Temporary Internet Files.

Browser cache if effective, will not have to again request the same server resources, and can be read directly from the local disk.

In addition, the cache server the same thing is that when judging the cache expires, will confirm the availability of resources to the source server. If the judge fails browser cache, browser requests the new resource again .

 

Guess you like

Origin www.cnblogs.com/cjj-ggboy/p/12567138.html