Chapter 4 gateway, tunnel and relay

Source: Internet
Author: User

Gateway

1. The Gateway can be used as a translator. It abstracts a method that can reach resources. A gateway is the adhesive between resources and applications. An application can request the gateway to process a request (through HTTP or other defined structures). The Gateway can provide a response. The gateway can send a query statement to the database or generate dynamic content, just like a door: enter a request and return a response. Some gateways automatically convert HTTP traffic to other protocols, so that the HTTP client can interact with other applications without having to understand other protocols.

2. the method used to direct HTTP traffic to the gateway is the same as that used to direct traffic to the proxy. The most common method is to explicitly configure the browser to use the gateway to transparently intercept traffic, or configure the gateway as a reverse proxy.

3. HTTP/*: Server web gateway

When a request is sent to the original server, the web gateway converts the HTTP request from the client to another protocol and transmits the request to the server. After obtaining the object, the object is put in an HTTP Response and sent back to the client.

4. https/HTTP: These gateways are usually used as invisible interception gateways or reverse proxies before Web servers. They receive secure https traffic and decrypt the security traffic, and send Common HTTP requests to the web server.

5. Resource Gateway: the client connects to the application server over HTTP, but the application server does not send back files. Instead, the request is sent through a gateway application programming interface (API) send to the application running on the server.

The first popular application gateway API is the general Gateway Interface (CGI ). CGI is a standard interface set. The web server can use it to load programs to respond to HTTP requests to specific URLs, collect program output data, and put it back in the HTTP response.

When a request needs to use gateway resources, the web server will ask the application to process the request. The server sends the data required by the application to it. This is usually the entire request. Then the application will return a response or response data to the server, and the server will forward it to the client. Servers and gateways are independent applications, so their responsibilities are clearly divided. This simple protocol (input request, transfer, and response) is the oldest and most commonly used Server Extension Interface CGI.

6. cgi applications are independent of servers, so they can be used in almost any language in advance. CGI processing is invisible to users. The client does not know the transfer process between the server and CGI application. The characters CGI and the possible "? "This is the only clue that the client found that CGI was used.


Tunnel

1. The web tunnel allows users to send non-http traffic over HTTP connections, so that they can upload data with other Protocols over HTTP. This type of traffic can pass through the firewall that only allows web traffic to pass.

2. The web tunnel is built using the http connect method. The connect method requests the tunnel gateway to create a TCP connection to any target server and port, and perform blind forwarding on the subsequent data between the client and the server. For details about how to create a tunnel, see p218.

3. The CONNECT request message is the same as the HTTP message, except that the method of the start line is connect. The response message does not need to contain the Content-Type header, because the connection only transfers the original bytes and is no longer the carrier of the message.

4. For the SSL tunneling mechanism, SSL is not required in the proxy. An SSL session is established between the client that generates the request and the target Web server. The proxy server in the middle only transmits encrypted data through a tunnel.


Relay

1. Http relay is a simple HTTP scheme that does not fully comply with HTTP specifications. Relay is responsible for processing the parts that establish connections in HTTP and then blind forwarding of bytes.

2. A more common problem in some simple blind relay implementations is that they may suspend the keep-alive connection because they cannot correctly handle the conneciton header.

This article from the "Lotus miss" blog, please be sure to keep this source http://liandesinian.blog.51cto.com/7737219/1558577

Chapter 4 gateway, tunnel and relay

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.